Problem with deserializing, CycleException: Invalid reference '100' found

View: New views
15 Messages — Rating Filter:   Alert me  

Problem with deserializing, CycleException: Invalid reference '100' found

by patb :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello Niall,

I have an urgend problem with the deserialization process and I really
hope you can help me with this. Please, have a look at this part of my
XML (which was serialized with SimpleXML 2.0.4):

------------
[...]
  <r2:protocolChangeLog xid="97">
    <r2:mission xref="0"/>
    <r2:time xid="98">2009-07-28 20:18:17.360 CEST</r2:time>
    <r2:property xid="99">person.title</r2:property>
    <r2:value xid="100"></r2:value>
  </r2:protocolChangeLog>
[...]
  <r2:protocolChangeLog xid="129">
    <r2:mission xref="0"/>
    <r2:time xid="130">2009-07-28 20:18:19.112 CEST</r2:time>
    <r2:property xref="99"/>
    <r2:value xref="100"/>
  </r2:protocolChangeLog>
[...]
------------    

I use CyclicStrategy and the id and reference tags are named "xid" and
"xref".

When I now try to deserialize the XML above (the complete XML of
course, not only that part), I get the following exception:

-------------
org.simpleframework.xml.graph.CycleException: Invalid reference '100' found
        at org.simpleframework.xml.graph.ReadGraph.getReference(ReadGraph.java:158)
        at org.simpleframework.xml.graph.ReadGraph.getInstance(ReadGraph.java:126)
        at org.simpleframework.xml.graph.ReadGraph.getElement(ReadGraph.java:107)
        at org.simpleframework.xml.graph.CycleStrategy.getElement(CycleStrategy.java:189)
-------------


Why is the reference '100' invalid? The "xid=100" comes before the
"xref=100", and the xid=100 is not missing. What is the problem here?

Another example is this part of the XML:

-------------
[...]
  <r2:doc xid="75">
    <r2:mission xref="0"/>
    <r2:person xid="76">
      <r2:forename xid="77"></r2:forename>
    </r2:person>
    <r2:art xid="78">KOSTENANERKENNUNG</r2:art>
    <r2:signature xref="77"/>
  </r2:doc>
[...]
-------------

Also with this example, SimpleXML throws the same exception, this time
with "Invalid reference '77' found". But you can clearly see that
there IS the xid=77 present, both attributes are of type String.


Now is is hard for me to provide example code, since it ais part of a
really big project. And it is also hard to reproduce the problem,
until now I can't tell exactly under which conditions the exception is
thrown. Unfortunately, it is a functionality that must work
tomorrow... so it is kind of urgend to find a solution...


I hope you have any idea how to solve this or what to do to identify
the problem.


I really appreciate your help!


Regards,
Timo




------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Simple-support mailing list
Simple-support@...
https://lists.sourceforge.net/lists/listinfo/simple-support

Re: Problem with deserializing, CycleException: Invalid reference '100' found

by niall.gallagher :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

This problem should be fixed in Simple 2.0.4 and above. What version are you deserializing with?

Niall


Niall Gallagher
RBS Global Banking & Markets
Office: +44 7879498724  

-----Original Message-----
From: Timo Rumland [mailto:cr@...]
Sent: 29 July 2009 13:02
To: simple-support@...
Subject: [Simple-support] Problem with deserializing, CycleException: Invalid reference '100' found

Hello Niall,

I have an urgend problem with the deserialization process and I really hope you can help me with this. Please, have a look at this part of my XML (which was serialized with SimpleXML 2.0.4):

------------
[...]
  <r2:protocolChangeLog xid="97">
    <r2:mission xref="0"/>
    <r2:time xid="98">2009-07-28 20:18:17.360 CEST</r2:time>
    <r2:property xid="99">person.title</r2:property>
    <r2:value xid="100"></r2:value>
  </r2:protocolChangeLog>
[...]
  <r2:protocolChangeLog xid="129">
    <r2:mission xref="0"/>
    <r2:time xid="130">2009-07-28 20:18:19.112 CEST</r2:time>
    <r2:property xref="99"/>
    <r2:value xref="100"/>
  </r2:protocolChangeLog>
[...]
------------    

I use CyclicStrategy and the id and reference tags are named "xid" and "xref".

When I now try to deserialize the XML above (the complete XML of course, not only that part), I get the following exception:

-------------
org.simpleframework.xml.graph.CycleException: Invalid reference '100' found
        at org.simpleframework.xml.graph.ReadGraph.getReference(ReadGraph.java:158)
        at org.simpleframework.xml.graph.ReadGraph.getInstance(ReadGraph.java:126)
        at org.simpleframework.xml.graph.ReadGraph.getElement(ReadGraph.java:107)
        at org.simpleframework.xml.graph.CycleStrategy.getElement(CycleStrategy.java:189)
-------------


Why is the reference '100' invalid? The "xid=100" comes before the "xref=100", and the xid=100 is not missing. What is the problem here?

Another example is this part of the XML:

-------------
[...]
  <r2:doc xid="75">
    <r2:mission xref="0"/>
    <r2:person xid="76">
      <r2:forename xid="77"></r2:forename>
    </r2:person>
    <r2:art xid="78">KOSTENANERKENNUNG</r2:art>
    <r2:signature xref="77"/>
  </r2:doc>
[...]
-------------

Also with this example, SimpleXML throws the same exception, this time with "Invalid reference '77' found". But you can clearly see that there IS the xid=77 present, both attributes are of type String.


Now is is hard for me to provide example code, since it ais part of a really big project. And it is also hard to reproduce the problem, until now I can't tell exactly under which conditions the exception is thrown. Unfortunately, it is a functionality that must work tomorrow... so it is kind of urgend to find a solution...


I hope you have any idea how to solve this or what to do to identify the problem.


I really appreciate your help!


Regards,
Timo




------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now.  http://p.sf.net/sfu/bobj-july _______________________________________________
Simple-support mailing list
Simple-support@...
https://lists.sourceforge.net/lists/listinfo/simple-support

***********************************************************************************
The Royal Bank of Scotland plc. Registered in Scotland No 90312. Registered Office: 36 St Andrew Square, Edinburgh EH2 2YB.
Authorised and regulated by the Financial Services Authority.
 
This e-mail message is confidential and for use by the
addressee only. If the message is received by anyone other
than the addressee, please return the message to the sender
by replying to it and then delete the message from your
computer. Internet e-mails are not necessarily secure. The
Royal Bank of Scotland plc does not accept responsibility for
changes made to this message after it was sent.

Whilst all reasonable care has been taken to avoid the
transmission of viruses, it is the responsibility of the recipient to
ensure that the onward transmission, opening or use of this
message and any attachments will not adversely affect its
systems or data. No responsibility is accepted by The
Royal Bank of Scotland plc in this regard and the recipient should carry
out such virus and other checks as it considers appropriate.

Visit our website at www.rbs.com

***********************************************************************************


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Simple-support mailing list
Simple-support@...
https://lists.sourceforge.net/lists/listinfo/simple-support

Re: Problem with deserializing, CycleException: Invalid reference '100' found

by patb :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello Niall,

> This problem should be fixed in Simple 2.0.4 and above. What version
> are you deserializing with?

thanks a lot for your answer. I am serializing and deserializing with
the same Version, with 2.0.4.


Is there a chance, that this bug may not be solved in 2.0.4? Can I do
anythink to help to identify the problem? I have the complete XML
file that causes the error, but i'm not allowed to send it to you.
I'll try anythink you say to help.


Thanks a lot!


Regards,
Timo


> Subject: [Simple-support] Problem with deserializing,
> CycleException: Invalid reference '100' found

> Hello Niall,

> I have an urgend problem with the deserialization process and I
> really hope you can help me with this. Please, have a look at this
> part of my XML (which was serialized with SimpleXML 2.0.4):

> ------------
> [...]
>   <r2:protocolChangeLog xid="97">
>     <r2:mission xref="0"/>
>     <r2:time xid="98">2009-07-28 20:18:17.360 CEST</r2:time>
>     <r2:property xid="99">person.title</r2:property>
>     <r2:value xid="100"></r2:value>
>   </r2:protocolChangeLog>
> [...]
>   <r2:protocolChangeLog xid="129">
>     <r2:mission xref="0"/>
>     <r2:time xid="130">2009-07-28 20:18:19.112 CEST</r2:time>
>     <r2:property xref="99"/>
>     <r2:value xref="100"/>
>   </r2:protocolChangeLog>
> [...]
> ------------    

> I use CyclicStrategy and the id and reference tags are named "xid" and "xref".

> When I now try to deserialize the XML above (the complete XML of
> course, not only that part), I get the following exception:

> -------------
> org.simpleframework.xml.graph.CycleException: Invalid reference '100' found
>         at
> org.simpleframework.xml.graph.ReadGraph.getReference(ReadGraph.java:158)
>         at
> org.simpleframework.xml.graph.ReadGraph.getInstance(ReadGraph.java:126)
>         at
> org.simpleframework.xml.graph.ReadGraph.getElement(ReadGraph.java:107)
>         at
> org.simpleframework.xml.graph.CycleStrategy.getElement(CycleStrategy.java:189)
> -------------


> Why is the reference '100' invalid? The "xid=100" comes before the
> "xref=100", and the xid=100 is not missing. What is the problem here?

> Another example is this part of the XML:

> -------------
> [...]
>   <r2:doc xid="75">
>     <r2:mission xref="0"/>
>     <r2:person xid="76">
>       <r2:forename xid="77"></r2:forename>
>     </r2:person>
>     <r2:art xid="78">KOSTENANERKENNUNG</r2:art>
>     <r2:signature xref="77"/>
>   </r2:doc>
> [...]
> -------------

> Also with this example, SimpleXML throws the same exception, this
> time with "Invalid reference '77' found". But you can clearly see
> that there IS the xid=77 present, both attributes are of type String.


> Now is is hard for me to provide example code, since it ais part of
> a really big project. And it is also hard to reproduce the problem,
> until now I can't tell exactly under which conditions the exception
> is thrown. Unfortunately, it is a functionality that must work
> tomorrow... so it is kind of urgend to find a solution...


> I hope you have any idea how to solve this or what to do to identify the problem.


> I really appreciate your help!


> Regards,
> Timo




> ------------------------------------------------------------------------------
> Let Crystal Reports handle the reporting - Free Crystal Reports
> 2008 30-Day trial. Simplify your report design, integration and
> deployment - and focus on what you do best, core application coding.
> Discover what's new with Crystal Reports now.
> http://p.sf.net/sfu/bobj-july
> _______________________________________________
> Simple-support mailing list
> Simple-support@...
> https://lists.sourceforge.net/lists/listinfo/simple-support

> ***********************************************************************************
> The Royal Bank of Scotland plc. Registered in Scotland No 90312.
> Registered Office: 36 St Andrew Square, Edinburgh EH2 2YB.
> Authorised and regulated by the Financial Services Authority.
>  
> This e-mail message is confidential and for use by the
> addressee only. If the message is received by anyone other
> than the addressee, please return the message to the sender
> by replying to it and then delete the message from your
> computer. Internet e-mails are not necessarily secure. The
> Royal Bank of Scotland plc does not accept responsibility for
> changes made to this message after it was sent.

> Whilst all reasonable care has been taken to avoid the
> transmission of viruses, it is the responsibility of the recipient to
> ensure that the onward transmission, opening or use of this
> message and any attachments will not adversely affect its
> systems or data. No responsibility is accepted by The
> Royal Bank of Scotland plc in this regard and the recipient should carry
> out such virus and other checks as it considers appropriate.

> Visit our website at www.rbs.com

> ***********************************************************************************



Beste Grüße,
Timo



------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Simple-support mailing list
Simple-support@...
https://lists.sourceforge.net/lists/listinfo/simple-support

Re: Problem with deserializing, CycleException: Invalid reference '100' found

by niall.gallagher :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

You should download the source and modify the CycleStrategy to dump out calls to getElement in the ReadGraph.java object. In the method

   public Value getElement(Class field, NodeMap node) throws Exception {

Add the following line.

Node xid = node.get("xid");
Node xref = node.get("xref");

if(xid != null) {
        System.err.println(node.getName() + ": "+xid.getName() "=" +xid.getValue());
}
if(xref != null) {
        System.err.println(node.getName() + ": "+xref.getName() "=" +xref.getValue());
}

This will show the callbacks in to the strategy. It should show the references you mention. If it does not then there may be a problem.


Niall Gallagher
RBS Global Banking & Markets
Office: +44 7879498724  

-----Original Message-----
From: GALLAGHER, Niall, GBM
Sent: 29 July 2009 13:40
To: 'Timo Rumland'; simple-support@...
Subject: RE: [Simple-support] Problem with deserializing, CycleException: Invalid reference '100' found

Hi,

This problem should be fixed in Simple 2.0.4 and above. What version are you deserializing with?

Niall


Niall Gallagher
RBS Global Banking & Markets
Office: +44 7879498724  

-----Original Message-----
From: Timo Rumland [mailto:cr@...]
Sent: 29 July 2009 13:02
To: simple-support@...
Subject: [Simple-support] Problem with deserializing, CycleException: Invalid reference '100' found

Hello Niall,

I have an urgend problem with the deserialization process and I really hope you can help me with this. Please, have a look at this part of my XML (which was serialized with SimpleXML 2.0.4):

------------
[...]
  <r2:protocolChangeLog xid="97">
    <r2:mission xref="0"/>
    <r2:time xid="98">2009-07-28 20:18:17.360 CEST</r2:time>
    <r2:property xid="99">person.title</r2:property>
    <r2:value xid="100"></r2:value>
  </r2:protocolChangeLog>
[...]
  <r2:protocolChangeLog xid="129">
    <r2:mission xref="0"/>
    <r2:time xid="130">2009-07-28 20:18:19.112 CEST</r2:time>
    <r2:property xref="99"/>
    <r2:value xref="100"/>
  </r2:protocolChangeLog>
[...]
------------    

I use CyclicStrategy and the id and reference tags are named "xid" and "xref".

When I now try to deserialize the XML above (the complete XML of course, not only that part), I get the following exception:

-------------
org.simpleframework.xml.graph.CycleException: Invalid reference '100' found
        at org.simpleframework.xml.graph.ReadGraph.getReference(ReadGraph.java:158)
        at org.simpleframework.xml.graph.ReadGraph.getInstance(ReadGraph.java:126)
        at org.simpleframework.xml.graph.ReadGraph.getElement(ReadGraph.java:107)
        at org.simpleframework.xml.graph.CycleStrategy.getElement(CycleStrategy.java:189)
-------------


Why is the reference '100' invalid? The "xid=100" comes before the "xref=100", and the xid=100 is not missing. What is the problem here?

Another example is this part of the XML:

-------------
[...]
  <r2:doc xid="75">
    <r2:mission xref="0"/>
    <r2:person xid="76">
      <r2:forename xid="77"></r2:forename>
    </r2:person>
    <r2:art xid="78">KOSTENANERKENNUNG</r2:art>
    <r2:signature xref="77"/>
  </r2:doc>
[...]
-------------

Also with this example, SimpleXML throws the same exception, this time with "Invalid reference '77' found". But you can clearly see that there IS the xid=77 present, both attributes are of type String.


Now is is hard for me to provide example code, since it ais part of a really big project. And it is also hard to reproduce the problem, until now I can't tell exactly under which conditions the exception is thrown. Unfortunately, it is a functionality that must work tomorrow... so it is kind of urgend to find a solution...


I hope you have any idea how to solve this or what to do to identify the problem.


I really appreciate your help!


Regards,
Timo




------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now.  http://p.sf.net/sfu/bobj-july _______________________________________________
Simple-support mailing list
Simple-support@...
https://lists.sourceforge.net/lists/listinfo/simple-support

***********************************************************************************
The Royal Bank of Scotland plc. Registered in Scotland No 90312. Registered Office: 36 St Andrew Square, Edinburgh EH2 2YB.
Authorised and regulated by the Financial Services Authority.
 
This e-mail message is confidential and for use by the
addressee only. If the message is received by anyone other
than the addressee, please return the message to the sender
by replying to it and then delete the message from your
computer. Internet e-mails are not necessarily secure. The
Royal Bank of Scotland plc does not accept responsibility for
changes made to this message after it was sent.

Whilst all reasonable care has been taken to avoid the
transmission of viruses, it is the responsibility of the recipient to
ensure that the onward transmission, opening or use of this
message and any attachments will not adversely affect its
systems or data. No responsibility is accepted by The
Royal Bank of Scotland plc in this regard and the recipient should carry
out such virus and other checks as it considers appropriate.

Visit our website at www.rbs.com

***********************************************************************************


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Simple-support mailing list
Simple-support@...
https://lists.sourceforge.net/lists/listinfo/simple-support

Re: Problem with deserializing, CycleException: Invalid reference '100' found

by patb :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello Niall,

> You should download the source and modify the CycleStrategy to dump
> out calls to getElement ....
> [...]

I really appreciate your help, I'm a bit under pressure right now to
get that working. I used SimpleXML for a long time now and never had
such problems.

I will definitively do what you suggested. I think I can do it
tomorrow, and see what the output of the code is.

Perhaps it is possible for me to isolate the program code, write a
small example app to demonstrate the problem.

Until then, thanks a lot for your help, I will post the result from
the source code modification soon.


Regards,
Timo




------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Simple-support mailing list
Simple-support@...
https://lists.sourceforge.net/lists/listinfo/simple-support

Re: Problem with deserializing, CycleException: Invalid reference '100' found

by niall.gallagher :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

Looks like this breaks on a 1.6 VM, which is strange. I will look a little closer in to this, and provide a fix that works with 1.5 and 1.6.

Niall


Niall Gallagher
RBS Global Banking & Markets
Office: +44 7879498724  

-----Original Message-----
From: Timo Rumland [mailto:cr@...]
Sent: 29 July 2009 22:04
To: GALLAGHER, Niall, GBM
Cc: simple-support@...
Subject: Re: [Simple-support] Problem with deserializing, CycleException: Invalid reference '100' found

Hello Niall,

> You should download the source and modify the CycleStrategy to dump
> out calls to getElement ....
> [...]

I really appreciate your help, I'm a bit under pressure right now to get that working. I used SimpleXML for a long time now and never had such problems.

I will definitively do what you suggested. I think I can do it tomorrow, and see what the output of the code is.

Perhaps it is possible for me to isolate the program code, write a small example app to demonstrate the problem.

Until then, thanks a lot for your help, I will post the result from the source code modification soon.


Regards,
Timo




***********************************************************************************
The Royal Bank of Scotland plc. Registered in Scotland No 90312. Registered Office: 36 St Andrew Square, Edinburgh EH2 2YB.
Authorised and regulated by the Financial Services Authority.
 
This e-mail message is confidential and for use by the
addressee only. If the message is received by anyone other
than the addressee, please return the message to the sender
by replying to it and then delete the message from your
computer. Internet e-mails are not necessarily secure. The
Royal Bank of Scotland plc does not accept responsibility for
changes made to this message after it was sent.

Whilst all reasonable care has been taken to avoid the
transmission of viruses, it is the responsibility of the recipient to
ensure that the onward transmission, opening or use of this
message and any attachments will not adversely affect its
systems or data. No responsibility is accepted by The
Royal Bank of Scotland plc in this regard and the recipient should carry
out such virus and other checks as it considers appropriate.

Visit our website at www.rbs.com

***********************************************************************************


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Simple-support mailing list
Simple-support@...
https://lists.sourceforge.net/lists/listinfo/simple-support

Re: Problem with deserializing, CycleException: Invalid reference '100' found

by patb :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hallo Niall,

> Looks like this breaks on a 1.6 VM, which is strange. I will look a
> little closer in to this, and provide a fix that works with 1.5 and
> 1.6.

yes I'm using Java 1.6.0_13 and _14. Can you already confirm that
this is a bug? Did you find something?

(I had no time up to now to use the source code and inspect the xid
and xref tags.)

It would be really great if you are able to identify the problem, and
maybe even fix it soon or, if you have no time to build a new releae,
just say where I can fix the problem in the source code.


Thanks a lot for your help


Regards,
Timo


> Niall


> Niall Gallagher
> RBS Global Banking & Markets
> Office: +44 7879498724  

> -----Original Message-----
> From: Timo Rumland [mailto:cr@...]
> Sent: 29 July 2009 22:04
> To: GALLAGHER, Niall, GBM
> Cc: simple-support@...
> Subject: Re: [Simple-support] Problem with deserializing,
> CycleException: Invalid reference '100' found

> Hello Niall,

>> You should download the source and modify the CycleStrategy to dump
>> out calls to getElement ....
>> [...]

> I really appreciate your help, I'm a bit under pressure right now
> to get that working. I used SimpleXML for a long time now and never had such problems.

> I will definitively do what you suggested. I think I can do it
> tomorrow, and see what the output of the code is.

> Perhaps it is possible for me to isolate the program code, write a
> small example app to demonstrate the problem.

> Until then, thanks a lot for your help, I will post the result from
> the source code modification soon.


> Regards,
> Timo




> ***********************************************************************************
> The Royal Bank of Scotland plc. Registered in Scotland No 90312.
> Registered Office: 36 St Andrew Square, Edinburgh EH2 2YB.
> Authorised and regulated by the Financial Services Authority.
>  
> This e-mail message is confidential and for use by the
> addressee only. If the message is received by anyone other
> than the addressee, please return the message to the sender
> by replying to it and then delete the message from your
> computer. Internet e-mails are not necessarily secure. The
> Royal Bank of Scotland plc does not accept responsibility for
> changes made to this message after it was sent.

> Whilst all reasonable care has been taken to avoid the
> transmission of viruses, it is the responsibility of the recipient to
> ensure that the onward transmission, opening or use of this
> message and any attachments will not adversely affect its
> systems or data. No responsibility is accepted by The
> Royal Bank of Scotland plc in this regard and the recipient should carry
> out such virus and other checks as it considers appropriate.

> Visit our website at www.rbs.com

> ***********************************************************************************



Beste Grüße,
Timo



------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Simple-support mailing list
Simple-support@...
https://lists.sourceforge.net/lists/listinfo/simple-support

Re: Problem with deserializing, CycleException: Invalid reference '100' found

by niall.gallagher :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I will look in to it. For now, a _hack_ that would work would be to "return null" instead of throwning the exception for the missing reference.

Niall


Niall Gallagher
RBS Global Banking & Markets
Office: +44 7879498724  

-----Original Message-----
From: Timo Rumland [mailto:cr@...]
Sent: 30 July 2009 15:57
To: GALLAGHER, Niall, GBM
Cc: simple-support@...
Subject: Re: [Simple-support] Problem with deserializing, CycleException: Invalid reference '100' found

Hallo Niall,

> Looks like this breaks on a 1.6 VM, which is strange. I will look a
> little closer in to this, and provide a fix that works with 1.5 and
> 1.6.

yes I'm using Java 1.6.0_13 and _14. Can you already confirm that this is a bug? Did you find something?

(I had no time up to now to use the source code and inspect the xid and xref tags.)

It would be really great if you are able to identify the problem, and maybe even fix it soon or, if you have no time to build a new releae, just say where I can fix the problem in the source code.


Thanks a lot for your help


Regards,
Timo


> Niall


> Niall Gallagher
> RBS Global Banking & Markets
> Office: +44 7879498724  

> -----Original Message-----
> From: Timo Rumland [mailto:cr@...]
> Sent: 29 July 2009 22:04
> To: GALLAGHER, Niall, GBM
> Cc: simple-support@...
> Subject: Re: [Simple-support] Problem with deserializing,
> CycleException: Invalid reference '100' found

> Hello Niall,

>> You should download the source and modify the CycleStrategy to dump
>> out calls to getElement ....
>> [...]

> I really appreciate your help, I'm a bit under pressure right now to
> get that working. I used SimpleXML for a long time now and never had such problems.

> I will definitively do what you suggested. I think I can do it
> tomorrow, and see what the output of the code is.

> Perhaps it is possible for me to isolate the program code, write a
> small example app to demonstrate the problem.

> Until then, thanks a lot for your help, I will post the result from
> the source code modification soon.


> Regards,
> Timo




> **********************************************************************
> ************* The Royal Bank of Scotland plc. Registered in Scotland
> No 90312.
> Registered Office: 36 St Andrew Square, Edinburgh EH2 2YB.
> Authorised and regulated by the Financial Services Authority.
>  
> This e-mail message is confidential and for use by the addressee only.
> If the message is received by anyone other than the addressee, please
> return the message to the sender by replying to it and then delete the
> message from your computer. Internet e-mails are not necessarily
> secure. The Royal Bank of Scotland plc does not accept responsibility
> for changes made to this message after it was sent.

> Whilst all reasonable care has been taken to avoid the transmission of
> viruses, it is the responsibility of the recipient to ensure that the
> onward transmission, opening or use of this message and any
> attachments will not adversely affect its systems or data. No
> responsibility is accepted by The Royal Bank of Scotland plc in this
> regard and the recipient should carry out such virus and other checks
> as it considers appropriate.

> Visit our website at www.rbs.com

> **********************************************************************
> *************



Beste Grüße,
Timo



------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Simple-support mailing list
Simple-support@...
https://lists.sourceforge.net/lists/listinfo/simple-support

Re: Problem with deserializing, CycleException: Invalid reference '100' found

by patb :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello Niall,

> I will look in to it. For now, a _hack_ that would work would be to
> "return null" instead of throwning the exception for the missing
> reference.

were you able to make some progress? We could isolate some XML data and
can safely reproduce the error / exception. Somehow, SimpleXML is not
able to find a XML reference as desdribed... I'm using Java 1.6.0_14,
and I tried Simple versions 2.0.4 and 2.1.2.



> You should download the source and modify the CycleStrategy to dump
> out calls to getElement in the ReadGraph.java object. In the method
>
>    public Value getElement(Class field, NodeMap node) throws Exception {
>
> Add the following line.
>
> [...]
> This will show the callbacks in to the strategy. It should show the
> references you mention. If it does not then there may be a problem.

We did modifiy the source code. The problematic xml ref was '100', and
the exception was:

  Exception in thread "main" org.simpleframework.xml.strategy.CycleException: Invalid reference '100' found

The last lines of my output looks like this:

  [...]
  value: xid=128
  protocolChangeLog: xid=129
  einsatz: xref=0
  time: xid=130
  property: xref=99
  value: xref=100

Exactly after this line the exception is thrown, please see the
stack trace:

-------------
Exception in thread "main" org.simpleframework.xml.strategy.CycleException: Invalid reference '100' found
        at org.simpleframework.xml.strategy.ReadGraph.getReference(ReadGraph.java:158)
        at org.simpleframework.xml.strategy.ReadGraph.getInstance(ReadGraph.java:125)
        at org.simpleframework.xml.strategy.ReadGraph.getElement(ReadGraph.java:106)
        at org.simpleframework.xml.strategy.CycleStrategy.getElement(CycleStrategy.java:205)
        [...]
-------------


> I will look in to it. For now, a _hack_ that would work would be to
> "return null" instead of throwning the exception for the missing
> reference.

If we return null instead of throwing the exception, the
deserialization process finishes without any error. But what are the
exact consequences of this? Shouldn't we expcet the deserialized
object to be in an "invalid" state or that some data is missing?


Thanks a lot for your help


Regards,
Timo


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Simple-support mailing list
Simple-support@...
https://lists.sourceforge.net/lists/listinfo/simple-support

Parent Message unknown Re: Problem with deserializing, CycleException: Invalid reference '100' found

by Timo Rumland-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hallo Niall,

after further debugging, we came up with some understanding of what
might be the bug. Please see again the problematic XML-part:

------------
[...]
  <r2:protocolChangeLog xid="97">
    <r2:mission xref="0"/>
    <r2:time xid="98">2009-07-28 20:18:17.360 CEST</r2:time>
    <r2:property xid="99">person.title</r2:property>
    <r2:value xid="100"></r2:value>
  </r2:protocolChangeLog>
[...]
  <r2:protocolChangeLog xid="129">
    <r2:mission xref="0"/>
    <r2:time xid="130">2009-07-28 20:18:19.112 CEST</r2:time>
    <r2:property xref="99"/>
    <r2:value xref="100"/>
  </r2:protocolChangeLog>
[...]
------------    


The line "<r2:value xid="100"></r2:value>" of SimpleXML's point of
view is "null". We saw that by adding some debug lines to the method

  xml.core.Primitive.readElement

The point is, that the result of the line

  "Object result = read(node, field)"

returns null for the the xid="100".

We now think that the "null" can't be added correctly to the
"lookup-map" (class ReadGraph, where the keys are stored) and thus
can't be read to lookup the value for that key/ref during the
deserialization process.

These are just ideas, we can't tell exactly what happens here.

Another thing is, that we discovered a missing "xid" in the
problematic XML file, so there was a xref="152" with an xid="152",
maybe there is a problem with the serialization process also.


I hope we could help a bit with those informations


Thanks a lot


Best regards,
Timo


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Simple-support mailing list
Simple-support@...
https://lists.sourceforge.net/lists/listinfo/simple-support

Parent Message unknown Re: Problem with deserializing, CycleException: Invalid reference '100' found

by patb :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hallo Niall,

(sorry, the first mail came wrong the wrong email address)

after further debugging, we came up with some understanding of what
might be the bug. Please see again the problematic XML-part:

------------
[...]
  <r2:protocolChangeLog xid="97">
    <r2:mission xref="0"/>
    <r2:time xid="98">2009-07-28 20:18:17.360 CEST</r2:time>
    <r2:property xid="99">person.title</r2:property>
    <r2:value xid="100"></r2:value>
  </r2:protocolChangeLog>
[...]
  <r2:protocolChangeLog xid="129">
    <r2:mission xref="0"/>
    <r2:time xid="130">2009-07-28 20:18:19.112 CEST</r2:time>
    <r2:property xref="99"/>
    <r2:value xref="100"/>
  </r2:protocolChangeLog>
[...]
------------    


The line "<r2:value xid="100"></r2:value>" of SimpleXML's point of
view is "null". We saw that by adding some debug lines to the method

  xml.core.Primitive.readElement

The point is, that the result of the line

  "Object result = read(node, field)"

returns null for the the xid="100".

We now think that the "null" can't be added correctly to the
"lookup-map" (class ReadGraph, where the keys are stored) and thus
can't be read to lookup the value for that key/ref during the
deserialization process.

These are just ideas, we can't tell exactly what happens here.

Another thing is, that we discovered a missing "xid" in the
problematic XML file, so there was a xref="152" with an xid="152",
maybe there is a problem with the serialization process also.


I hope we could help a bit with those informations


Thanks a lot


Best regards,
Timo


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Simple-support mailing list
Simple-support@...
https://lists.sourceforge.net/lists/listinfo/simple-support

Parent Message unknown Re: Problem with deserializing, CycleException: Invalid reference '100' found

by patb :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello again,

a small correction to my last email:

> Another thing is, that we discovered a missing "xid" in the
> problematic XML file, so there was a xref="152" with an xid="152",
> maybe there is a problem with the serialization process also.

of course I meant

  "so there was a xref="152" WITHOUT an xid="152" "


Best regards,
Timo


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Simple-support mailing list
Simple-support@...
https://lists.sourceforge.net/lists/listinfo/simple-support

Re: Problem with deserializing, CycleException: Invalid reference '100' found

by Niall Gallagher-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hi,

Ya, could be something like that. Whats most annoying about this is that if works without issue on a Mac with Java 1.6, but on windows it does not work for 1.6. Just plain odd.

I will look in to it.

Niall

--- On Sun, 8/2/09, Timo Rumland <timo.rumland@...> wrote:

> From: Timo Rumland <timo.rumland@...>
> Subject: Re: [Simple-support] Problem with deserializing, CycleException: Invalid reference '100' found
> To: niall.gallagher@...
> Cc: "Johannes Ohlemacher" <johannes.ohlemacher@...>, simple-support@...
> Date: Sunday, August 2, 2009, 2:00 AM
> Hallo Niall,
>
> after further debugging, we came up with some understanding
> of what
> might be the bug. Please see again the problematic
> XML-part:
>
> ------------
> [...]
>   <r2:protocolChangeLog xid="97">
>     <r2:mission xref="0"/>
>     <r2:time xid="98">2009-07-28
> 20:18:17.360 CEST</r2:time>
>     <r2:property
> xid="99">person.title</r2:property>
>     <r2:value xid="100"></r2:value>
>   </r2:protocolChangeLog>
> [...]
>   <r2:protocolChangeLog xid="129">
>     <r2:mission xref="0"/>
>     <r2:time xid="130">2009-07-28
> 20:18:19.112 CEST</r2:time>
>     <r2:property xref="99"/>
>     <r2:value xref="100"/>
>   </r2:protocolChangeLog>
> [...]
> ------------   
>
>
> The line "<r2:value xid="100"></r2:value>" of
> SimpleXML's point of
> view is "null". We saw that by adding some debug lines to
> the method
>
>   xml.core.Primitive.readElement
>
> The point is, that the result of the line
>
>   "Object result = read(node, field)"
>
> returns null for the the xid="100".
>
> We now think that the "null" can't be added correctly to
> the
> "lookup-map" (class ReadGraph, where the keys are stored)
> and thus
> can't be read to lookup the value for that key/ref during
> the
> deserialization process.
>
> These are just ideas, we can't tell exactly what happens
> here.
>
> Another thing is, that we discovered a missing "xid" in
> the
> problematic XML file, so there was a xref="152" with an
> xid="152",
> maybe there is a problem with the serialization process
> also.
>
>
> I hope we could help a bit with those informations
>
>
> Thanks a lot
>
>
> Best regards,
> Timo
>
>
> ------------------------------------------------------------------------------
> Let Crystal Reports handle the reporting - Free Crystal
> Reports 2008 30-Day
> trial. Simplify your report design, integration and
> deployment - and focus on
> what you do best, core application coding. Discover what's
> new with
> Crystal Reports now.  http://p.sf.net/sfu/bobj-july
> _______________________________________________
> Simple-support mailing list
> Simple-support@...
> https://lists.sourceforge.net/lists/listinfo/simple-support
>


     

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Simple-support mailing list
Simple-support@...
https://lists.sourceforge.net/lists/listinfo/simple-support

Re: Problem with deserializing, CycleException: Invalid reference '100' found

by patb :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Niall,

> Ya, could be something like that. Whats most annoying about this is
> that if works without issue on a Mac with Java 1.6, but on windows
> it does not work for 1.6. Just plain odd.

I'm glad you were able to reproduce the problem.

This is actually a weird thing... to do some debugging, we added some
logger instructions to the code. Before that, the missing ref was
always "100" - after adding the logger lines, suddenly the missing ref
was "65". How can some lines of logger code change the error-
behavior? I don't know...


If I can help in any way, please say so.


Thanks a lot


Regards,
Timo



------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Simple-support mailing list
Simple-support@...
https://lists.sourceforge.net/lists/listinfo/simple-support

Re: Problem with deserializing, CycleException: Invalid reference '100' found

by niall.gallagher :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

In the class Primitive.java change the following

   private Object readElement(InputNode node, Instance value) throws Exception {
      Object result = read(node, field);
     
      if(result != null) {
         value.setInstance(result);
      }
      return result;
   }

To

   private Object readElement(InputNode node, Instance value) throws Exception {
      Object result = read(node, field);
     
      if(value != null) {
         value.setInstance(result);
      }
      return result;
   }

It will work then.

Niall

Niall Gallagher
RBS Global Banking & Markets
Office: +44 7879498724  

-----Original Message-----
From: Timo Rumland [mailto:cr@...]
Sent: 02 August 2009 22:14
To: Niall Gallagher
Cc: GALLAGHER, Niall, GBM; Johannes Ohlemacher; simple-support@...
Subject: Re: [Simple-support] Problem with deserializing, CycleException: Invalid reference '100' found

Hi Niall,

> Ya, could be something like that. Whats most annoying about this is
> that if works without issue on a Mac with Java 1.6, but on windows it
> does not work for 1.6. Just plain odd.

I'm glad you were able to reproduce the problem.

This is actually a weird thing... to do some debugging, we added some logger instructions to the code. Before that, the missing ref was always "100" - after adding the logger lines, suddenly the missing ref was "65". How can some lines of logger code change the error- behavior? I don't know...


If I can help in any way, please say so.


Thanks a lot


Regards,
Timo



***********************************************************************************
The Royal Bank of Scotland plc. Registered in Scotland No 90312. Registered Office: 36 St Andrew Square, Edinburgh EH2 2YB.
Authorised and regulated by the Financial Services Authority.
 
This e-mail message is confidential and for use by the
addressee only. If the message is received by anyone other
than the addressee, please return the message to the sender
by replying to it and then delete the message from your
computer. Internet e-mails are not necessarily secure. The
Royal Bank of Scotland plc does not accept responsibility for
changes made to this message after it was sent.

Whilst all reasonable care has been taken to avoid the
transmission of viruses, it is the responsibility of the recipient to
ensure that the onward transmission, opening or use of this
message and any attachments will not adversely affect its
systems or data. No responsibility is accepted by The
Royal Bank of Scotland plc in this regard and the recipient should carry
out such virus and other checks as it considers appropriate.

Visit our website at www.rbs.com

***********************************************************************************


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Simple-support mailing list
Simple-support@...
https://lists.sourceforge.net/lists/listinfo/simple-support