Issue using XStreamToObject
tobysaville Oct 9, 2007 10:37 AMHello,
I am trying to convert xml to an object using the XStreamToObject action. I use the SystemPrintln action to print the xml that is being passed in (which is generated from XStream originally):
12:27:29,337 INFO [STDOUT] [<com.easynet.ripe.model.AllocationRequest> <addressLine1>line1</addressLine1> <multiline>0</multiline> <ipSize>0</ipSize> <nat>false</nat> <smpf>false</smpf> <ripeUsername>toby.saville</ripeUsername> <ripePassword>letmein</ripePassword> </com.easynet.ripe.model.AllocationRequest>].
And the stack trace that gets generated by the XStreamToObject action when it tries to convert it into an object:
12:27:42,524 WARN [ActionProcessingPipeline] Unexpected exception caught while processing the action pipeline com.thoughtworks.xstream.converters.ConversionException: addressLine1 : No ClassLoaders found for: addressLine1 ---- Debugging information ---- required-type : com.easynet.ripe.model.AllocationRequest cause-message : addressLine1 : No ClassLoaders found for: addressLine1 class : com.easynet.ripe.model.AllocationRequest message : addressLine1 : No ClassLoaders found for: addressLine1 path : /com.easynet.ripe.model.AllocationRequest/addressLine1 cause-exception : com.thoughtworks.xstream.alias.CannotResolveClassException ------------------------------- at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:45) at com.thoughtworks.xstream.core.ReferenceByXPathUnmarshaller.convertAnother(ReferenceByXPathUnmarshaller.java:39) at com.thoughtworks.xstream.core.TreeUnmarshaller.start(TreeUnmarshaller.java:99) at com.thoughtworks.xstream.core.ReferenceByXPathMarshallingStrategy.unmarshal(ReferenceByXPathMarshallingStrategy.java:12) at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:552) at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:540) at org.jboss.soa.esb.actions.converters.XStreamToObject.fromXmlToObject(XStreamToObject.java:187) at org.jboss.soa.esb.actions.converters.XStreamToObject.process(XStreamToObject.java:106) at org.jboss.soa.esb.listeners.message.ActionProcessingPipeline.process(ActionProcessingPipeline.java:265) at org.jboss.soa.esb.listeners.message.MessageAwareListener$1.run(MessageAwareListener.java:297) 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) Caused by: com.thoughtworks.xstream.alias.CannotResolveClassException: addressLine1 : No ClassLoaders found for: addressLine1 at com.thoughtworks.xstream.mapper.DefaultMapper.realClass(DefaultMapper.java:35) at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:18) at com.thoughtworks.xstream.mapper.XmlFriendlyMapper.realClass(XmlFriendlyMapper.java:44) at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:18) at com.thoughtworks.xstream.mapper.ClassAliasingMapper.realClass(ClassAliasingMapper.java:49) at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:18) at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:18) at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:18) at com.thoughtworks.xstream.mapper.DynamicProxyMapper.realClass(DynamicProxyMapper.java:46) at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:18) at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:18) at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:18) at com.thoughtworks.xstream.mapper.ArrayMapper.realClass(ArrayMapper.java:70) at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:18) at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:18) at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:18) at com.thoughtworks.xstream.mapper.CachingMapper.realClass(CachingMapper.java:27) at com.thoughtworks.xstream.converters.reflection.ReflectionConverter.determineType(ReflectionConverter.java:179) at com.thoughtworks.xstream.converters.reflection.ReflectionConverter.unmarshal(ReflectionConverter.java:102) at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:38) ... 12 more
Could it be that the new line is confusing things somewhere?
I constructed a unit test to use this action outside of the ESB and it all works fine.
Any suggestions on why this might be?
cheers,
Toby