Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assistance Needed for XStream Conversion Issue with Policy Object - Invalid Reference Error. #364

Open
rani111agrawal opened this issue Nov 14, 2024 · 3 comments
Assignees
Labels

Comments

@rani111agrawal
Copy link

am encountering an error while converting a Policy object into XML using XStream, and I require assistance to resolve it. The conversion process fails with an Invalid reference error. Below are the error details:

Error Stack Trace:

com.thoughtworks.xstream.converters.ConversionException: Invalid reference
---- Debugging information ----
message : Invalid reference
reference : ../../storedSnapshot/com.csc.pt.svc.data.relational.entity.ClientNameBasicContract
referenced-type : com.csc.pt.svc.data.relational.entity.ClientNameBasicContract
referenceable : true
class : java.util.HashSet
required-type : java.util.HashSet
converter-type : com.thoughtworks.xstream.converters.collections.CollectionConverter
path : /com.csc.pt.svc.data.relational.entity.Policy/clientNameBasicContract/set/com.csc.pt.svc.data.relational.entity.ClientNameBasicContract
line number : 1
class[1] : org.hibernate.collection.spi.PersistentSet
required-type[1] : org.hibernate.collection.spi.PersistentSet
converter-type[1] : com.thoughtworks.xstream.converters.reflection.ReflectionConverter
class[2] : com.csc.pt.svc.data.relational.entity.Policy
required-type[2] : com.csc.pt.svc.data.relational.entity.Policy
version : not available

Potential Cause: The error appears related to the clientNameBasicContract node, specifically with the PersistentSet collection type used by Hibernate. It seems that XStream may be struggling with the PersistentSet conversion, particularly when referencing stored snapshots.

false true -1 com.csc.pt.svc.data.relational.entity.Policy.clientNameBasicContract false false 192 1 INSURED PMSIPP05 dbo 2024-11-11 03:03:07 00 05 WCV 4343485 00 false ** ** Environment Details:

Hibernate version: 6.5.2
XStream version: [Version here]
Java version: 17
Could you please provide guidance on how to handle this reference error? Specifically, I’m interested in understanding:

If a specific configuration or XStream version would avoid these reference issues.
Any suggestions on customizing the conversion to handle PersistentSet or storedSnapshot differently.
Whether removing or altering the node is advisable in this context.
Thank you for your assistance.

@rani111agrawal rani111agrawal changed the title Assistance Needed for XStream Conversion Issue with Policy Object - Invalid Reference Error Assistance Needed for XStream Conversion Issue with Policy Object - Invalid Reference Error. Nov 15, 2024
@rani111agrawal
Copy link
Author

@joehni could you please help?

@joehni joehni self-assigned this Nov 17, 2024
@joehni
Copy link
Member

joehni commented Nov 17, 2024

XStream's Hibernate support in version 1.4.x is very old. Have a look at pull request #346 to support version 6.x.

@rani111agrawal
Copy link
Author

Thank you @joehni for your support. It is working fine now! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants