XStream

CGLIB enhanced proxies with multiple callbacks related exception

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Resolution: Won't Fix
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None
  • JDK version and platform:
    sun 1.5_09

Description

com.thoughtworks.xstream.converters.ConversionException: Cannot handle CGLIB enhanced proxies with multiple callbacks
---- Debugging information ----
-------------------------------
at com.thoughtworks.xstream.converters.reflection.CGLIBEnhancedConverter.marshal(CGLIBEnhancedConverter.java:85)
at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:59)
at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:50)
at com.thoughtworks.xstream.annotations.AnnotationReflectionConverter.marshallField(AnnotationReflectionConverter.java:37)
at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$2.writeField(AbstractReflectionConverter.java:105)
at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$2.visit(AbstractReflectionConverter.java:81)
at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:109)
at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.doMarshal(AbstractReflectionConverter.java:66)
at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.marshal(AbstractReflectionConverter.java:41)
at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:59)
at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:50)
at com.thoughtworks.xstream.core.TreeMarshaller.start(TreeMarshaller.java:73)
at com.thoughtworks.xstream.core.ReferenceByXPathMarshallingStrategy.marshal(ReferenceByXPathMarshallingStrategy.java:34)
at com.thoughtworks.xstream.XStream.marshal(XStream.java:745)
at com.thoughtworks.xstream.XStream.marshal(XStream.java:734)
at com.thoughtworks.xstream.XStream.toXML(XStream.java:715)
at com.thoughtworks.xstream.XStream.toXML(XStream.java:705)
at
...
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
at java.lang.Thread.run(Thread.java:595)

Activity

Hide
Joerg Schaible added a comment -

It's a technical limitation, the proxy cannot be crecreated anymore due to missing information. Nothing we can do about.

Show
Joerg Schaible added a comment - It's a technical limitation, the proxy cannot be crecreated anymore due to missing information. Nothing we can do about.
Hide
Goksel Uyulmaz added a comment -

is there something wrong with my code, I mean why it is happening?

Show
Goksel Uyulmaz added a comment - is there something wrong with my code, I mean why it is happening?
Hide
Goksel Uyulmaz added a comment -

this exception is comming with ver 1.2,
I dont have any problem with ver 1.1.3

Show
Goksel Uyulmaz added a comment - this exception is comming with ver 1.2, I dont have any problem with ver 1.1.3
Hide
Joerg Schaible added a comment -

You (or a library you're using ... Hibernate?) is using such proxies generated by CGLIB and try to process them with XStream. It is not possible to deserialise such objects though (long story), therefore the exception is raised. If you can identify, which class is proxied, you can write an own custom converter for it (or the class that contain the objects), that has its own strategies - it simply depends on the class. But this is a topic for the user's list and not for JIRA here.

Show
Joerg Schaible added a comment - You (or a library you're using ... Hibernate?) is using such proxies generated by CGLIB and try to process them with XStream. It is not possible to deserialise such objects though (long story), therefore the exception is raised. If you can identify, which class is proxied, you can write an own custom converter for it (or the class that contain the objects), that has its own strategies - it simply depends on the class. But this is a topic for the user's list and not for JIRA here.
Hide
Goksel Uyulmaz added a comment -

the problem was at hibernate and me of course. lazy loading was the source of problem. the object I passed to xstream.toXml was from hibernate, some parts of the object was lazy loaded. I made lazy="false" for them and the problem disappeared!
Thanks for the quick replay.

Show
Goksel Uyulmaz added a comment - the problem was at hibernate and me of course. lazy loading was the source of problem. the object I passed to xstream.toXml was from hibernate, some parts of the object was lazy loaded. I made lazy="false" for them and the problem disappeared! Thanks for the quick replay.
Hide
Attila Szegedi added a comment -

Just an interesting tidbit of information – we've been using Hibernate + XStream for a while, and didn't have any problems with lazy loading. Mind you, this was with Hibernate 2.1.x and CGLIB 2.0.2. When we upgraded to Hibernate 3 and CGLIB 2.1.3 (H3 needs CGLIB 2.1.x), we started seeing this problem.

This at least suggests that peaceful coexistence of Hibernate and XStream is possible, as it worked with an older Hibernate. However, with H3 + CGLIB 2.1.3, it indeed blows up.

Show
Attila Szegedi added a comment - Just an interesting tidbit of information – we've been using Hibernate + XStream for a while, and didn't have any problems with lazy loading. Mind you, this was with Hibernate 2.1.x and CGLIB 2.0.2. When we upgraded to Hibernate 3 and CGLIB 2.1.3 (H3 needs CGLIB 2.1.x), we started seeing this problem. This at least suggests that peaceful coexistence of Hibernate and XStream is possible, as it worked with an older Hibernate. However, with H3 + CGLIB 2.1.3, it indeed blows up.
Hide
Michael Prescott added a comment -

Attila, you're having the problem with Hibernate 3 because it turns lazy loading on by default (because it's such a good idea). Turning lazy loading off will fix the XStream problem you're having, but that may have performance implications for your database access.

Show
Michael Prescott added a comment - Attila, you're having the problem with Hibernate 3 because it turns lazy loading on by default (because it's such a good idea). Turning lazy loading off will fix the XStream problem you're having, but that may have performance implications for your database access.

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: