[jboss-user] [JBossWS] - Re: avoid lazy-initialization exceptions

ghinkle do-not-reply at jboss.com
Tue Oct 30 15:32:36 EDT 2007


So I went and tried a few different ways to solve this. I implemented a XmlAdapter thinking I could inject some code into the marshalling process to null out the relationships before jaxb tries to do its thing.


  | @javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter(org.jboss.on.domain.util.EJBXMLTypeAdaptor.class)
  | 

Doing this on the entity class and having the adapter just returned the cleaned-up object results in:


  | javax.xml.bind.JAXBException: org.jboss.on.domain.auth.Subject nor any of its super class is known to this context
  | 

It doesn't look like many people understand XmlAdapters given what I've been able to find on Google. Any ideas how to just get access to the object, but still have JAXB do the marshalling?

I also tried putting the adapter on the relationship collection field that is lazy (and set the accessor type to FIELD), but it never ran my adapter in that case. Putting the adapter on the accessors didn't seem to get picked up.




View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4100420#4100420

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4100420



More information about the jboss-user mailing list