Hi 
Jörg,
The XStreamMarshaller.marshal() calls 
com.thoughtworks.xstream.XStream.marshal(Object, 
com.thoughtworks.xstream.io.xml.CompactWriter), where the first argument Object 
has the root of the object graph to marshal. So, the Spring stuff is wraparound 
only. If there is a way XStream deals with (basically unproxies for real 
objects) the javaassist proxy, I can probably plug it in to the Spring 
wrappers. 
(marshallingStrategy = 
com.thoughtworks.xtream.core.RefernceByXPathMarshallingStrategy, mapper = 
com.thoughtworks.xtream.mapper.CachingMapper, converterLookup =  
com.thoughtworks.xtream.core.DefaultConverterLookup)
- amit.



> To: [email protected]
> From: [email protected]
> Date: Wed, 11 Apr 2012 08:46:31 +0200
> Subject: [xstream-user] Re: XStreamMarshaller does not unproxy at marshalling
> 
> Hi Amit,
> 
> Amit Basu wrote:
> 
> > 
> > I use a
> > org.springframework.http.converter.xml.MarshallingHttpMessageConverter
> > with org.springframework.oxm.xstream.XStreamMarshaller as
> > marshaller/unmarshaller. With default-lazy=false hibernate-mapping,
> > org.springframework.web.client.RestTemplate.getForObject() works fine. But
> > with default-lazy = true, some contained objects from the top-level object
> > are org.hibernate.proxy.pojo.javassist.SerializableProxy, which makes the
> > getForObject() fail, with org.hibernate.LazyInitializationException- could
> > not initialize proxy - no Session Is there a way to get the marshaller to
> > initialize and unproxy as needed, when writing to the stream ? I want to
> > have the same API calls for REST and non-REST situations (non-REST = local
> > JVM calls that can make further calls with the Hibernate session, to get
> > contents from proxies as needed), and ideally default-lazy = true is
> > preferred for non-REST calls, but then if the same call is used by a REST
> > controller, the marshalling keeps the proxies as is currently.
> 
> maybe you better ask the Spring people? None of the classes mentioned above 
> are delivered by XStream.
> 
> - Jörg
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
> 
>     http://xircles.codehaus.org/manage_email
> 
> 
                                          

Reply via email to