I don't know you got time to look at this issue. I have small update on this issue and still have a open question.
I modified return type to DataObject[] instead of Collection<DataObject>. Now, I don't see this exception but, size of object received at client is different from size of object returned by service. Client is always receiving 1 element. I even tried with standard type String (String[] instead of Collection<String>), same observation. Is anything fundamentally wrong or am I doing something wrong? Regards Raman From: Malisetti, Ramanjaneyulu [mailto:ramanjaneyulu.malise...@ca.com] Sent: Wednesday, 17 March 2010 12:46 AM To: user@tuscany.apache.org Subject: serializtion error while invoking method that returns Collection<DataObject> Hi, I have SCA service bound to JMS binding and using SDO DataBinding. I am encountering the following exception while client is invoking a method that returns Collection<DataObject>. Out of curiosity, I have added another method that returns Collection<String>, this method is successfully returning, but, to my surprise, client got list only with size 1 instead of actual size of the arraylist returned by the service implementation. I attached source at [1] for your reference. What is the wrong with serialization, why below exception shows JAXB databinding instead of SDO databinding? Why client could not receive object as it is returned by service in case of Collection<String>? [1] https://issues.apache.org/jira/browse/TUSCANY-3499 <https://issues.apache.org/jira/browse/TUSCANY-3499> Mar 16, 2010 11:52:07 PM org.apache.tuscany.sca.binding.jms.transport.TransportServiceInterceptor invoke SEVERE: Exception invoking service 'HelloWorldService java.lang.RuntimeException: Cannot serialize OM Element return at org.apache.axiom.om.impl.llom.OMSourcedElementImpl.toString(OMSourcedEle mentImpl.java:913) at org.apache.tuscany.sca.binding.jms.provider.DefaultMessageProcessor.inse rtPayloadIntoJMSBytesMessage(DefaultMessageProcessor.java:235) at org.apache.tuscany.sca.binding.jms.wireformat.jmsdefault.runtime.WireFor matJMSDefaultServiceInterceptor.invokeResponse(WireFormatJMSDefaultServi ceInterceptor.java:158) at org.apache.tuscany.sca.binding.jms.wireformat.jmsdefault.runtime.WireFor matJMSDefaultServiceInterceptor.invoke(WireFormatJMSDefaultServiceInterc eptor.java:87) at org.apache.tuscany.sca.binding.jms.wire.CallbackDestinationInterceptor.i nvoke(CallbackDestinationInterceptor.java:55) at org.apache.tuscany.sca.binding.jms.wire.OperationPropertiesInterceptor.i nvoke(OperationPropertiesInterceptor.java:62) at org.apache.tuscany.sca.binding.jms.operationselector.jmsdefault.runtime. OperationSelectorJMSDefaultServiceInterceptor.invoke(OperationSelectorJM SDefaultServiceInterceptor.java:88) at org.apache.tuscany.sca.binding.jms.transport.TransportServiceInterceptor .invoke(TransportServiceInterceptor.java:77) at org.apache.tuscany.sca.core.assembly.RuntimeWireImpl.invoke(RuntimeWireI mpl.java:163) at org.apache.tuscany.sca.host.jms.asf.ServiceInvoker.invokeService(Service Invoker.java:94) at org.apache.tuscany.sca.host.jms.asf.ServiceInvoker.onMessage(ServiceInvo ker.java:70) at org.apache.activemq.ActiveMQMessageConsumer.dispatch(ActiveMQMessageCons umer.java:1021) at org.apache.activemq.ActiveMQSessionExecutor.dispatch(ActiveMQSessionExec utor.java:122) at org.apache.activemq.ActiveMQSessionExecutor.iterate(ActiveMQSessionExecu tor.java:192) at org.apache.activemq.thread.PooledTaskRunner.runTask(PooledTaskRunner.jav a:122) at org.apache.activemq.thread.PooledTaskRunner$1.run(PooledTaskRunner.java: 43) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecuto r.java:885) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.ja va:907) at java.lang.Thread.run(Thread.java:619) Caused by: javax.xml.stream.XMLStreamException: javax.xml.bind.MarshalException - with linked exception: [javax.xml.bind.JAXBException: class java.util.ArrayList nor any of its super class is known to this context.] at org.apache.tuscany.sca.databinding.jaxb.axiom.JAXBDataSource.serialize(J AXBDataSource.java:158) at org.apache.axiom.om.impl.llom.OMSourcedElementImpl.toString(OMSourcedEle mentImpl.java:908) ... 18 more Caused by: javax.xml.bind.MarshalException - with linked exception: [javax.xml.bind.JAXBException: class java.util.ArrayList nor any of its super class is known to this context.] at com.sun.xml.bind.v2.runtime.MarshallerImpl.write(MarshallerImpl.java:331 ) at com.sun.xml.bind.v2.runtime.MarshallerImpl.marshal(MarshallerImpl.java:2 57) at javax.xml.bind.helpers.AbstractMarshallerImpl.marshal(AbstractMarshaller Impl.java:96) at org.apache.tuscany.sca.databinding.jaxb.axiom.JAXBDataSource$3.run(JAXBD ataSource.java:150) at java.security.AccessController.doPrivileged(Native Method) at org.apache.tuscany.sca.databinding.jaxb.axiom.JAXBDataSource.serialize(J AXBDataSource.java:145) ... 19 more Caused by: javax.xml.bind.JAXBException: class java.util.ArrayList nor any of its super class is known to this context. at com.sun.xml.bind.v2.runtime.XMLSerializer.reportError(XMLSerializer.java :242) at com.sun.xml.bind.v2.runtime.XMLSerializer.reportError(XMLSerializer.java :257) at com.sun.xml.bind.v2.runtime.XMLSerializer.childAsXsiType(XMLSerializer.j ava:649) at com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl$1.serializeBody(ElementB eanInfoImpl.java:151) at com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl$1.serializeBody(ElementB eanInfoImpl.java:185) at com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl.serializeBody(ElementBea nInfoImpl.java:305) at com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl.serializeRoot(ElementBea nInfoImpl.java:312) at com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl.serializeRoot(ElementBea nInfoImpl.java:71) at com.sun.xml.bind.v2.runtime.XMLSerializer.childAsRoot(XMLSerializer.java :490) at com.sun.xml.bind.v2.runtime.MarshallerImpl.write(MarshallerImpl.java:328 ) ... 24 more Caused by: javax.xml.bind.JAXBException: class java.util.ArrayList nor any of its super class is known to this context. at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getBeanInfo(JAXBContextImpl. java:556) at com.sun.xml.bind.v2.runtime.XMLSerializer.childAsXsiType(XMLSerializer.j ava:644) ... 31 more Regards Raman