Uploaded image for project: 'Tuscany'
  1. Tuscany
  2. TUSCANY-3499

serializtion error while invoking method that returns Collection<DataObject>

    XMLWordPrintableJSON

Details

    Description

      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 service side implementation.

      Here, I attached source 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>?
      Serverside
      ===========

      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(OMSourcedElementImpl.java:913)
      at org.apache.tuscany.sca.binding.jms.provider.DefaultMessageProcessor.insertPayloadIntoJMSBytesMessage(DefaultMessageProcessor.java:235)
      at org.apache.tuscany.sca.binding.jms.wireformat.jmsdefault.runtime.WireFormatJMSDefaultServiceInterceptor.invokeResponse(WireFormatJMSDefaultServiceInterceptor.java:158)
      at org.apache.tuscany.sca.binding.jms.wireformat.jmsdefault.runtime.WireFormatJMSDefaultServiceInterceptor.invoke(WireFormatJMSDefaultServiceInterceptor.java:87)
      at org.apache.tuscany.sca.binding.jms.wire.CallbackDestinationInterceptor.invoke(CallbackDestinationInterceptor.java:55)
      at org.apache.tuscany.sca.binding.jms.wire.OperationPropertiesInterceptor.invoke(OperationPropertiesInterceptor.java:62)
      at org.apache.tuscany.sca.binding.jms.operationselector.jmsdefault.runtime.OperationSelectorJMSDefaultServiceInterceptor.invoke(OperationSelectorJMSDefaultServiceInterceptor.java:88)
      at org.apache.tuscany.sca.binding.jms.transport.TransportServiceInterceptor.invoke(TransportServiceInterceptor.java:77)
      at org.apache.tuscany.sca.core.assembly.RuntimeWireImpl.invoke(RuntimeWireImpl.java:163)
      at org.apache.tuscany.sca.host.jms.asf.ServiceInvoker.invokeService(ServiceInvoker.java:94)
      at org.apache.tuscany.sca.host.jms.asf.ServiceInvoker.onMessage(ServiceInvoker.java:70)
      at org.apache.activemq.ActiveMQMessageConsumer.dispatch(ActiveMQMessageConsumer.java:1021)
      at org.apache.activemq.ActiveMQSessionExecutor.dispatch(ActiveMQSessionExecutor.java:122)
      at org.apache.activemq.ActiveMQSessionExecutor.iterate(ActiveMQSessionExecutor.java:192)
      at org.apache.activemq.thread.PooledTaskRunner.runTask(PooledTaskRunner.java:122)
      at org.apache.activemq.thread.PooledTaskRunner$1.run(PooledTaskRunner.java:43)
      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java: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(JAXBDataSource.java:158)
        at org.apache.axiom.om.impl.llom.OMSourcedElementImpl.toString(OMSourcedElementImpl.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:257)
        at javax.xml.bind.helpers.AbstractMarshallerImpl.marshal(AbstractMarshallerImpl.java:96)
        at org.apache.tuscany.sca.databinding.jaxb.axiom.JAXBDataSource$3.run(JAXBDataSource.java:150)
        at java.security.AccessController.doPrivileged(Native Method)
        at org.apache.tuscany.sca.databinding.jaxb.axiom.JAXBDataSource.serialize(JAXBDataSource.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.java:649)
        at com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl$1.serializeBody(ElementBeanInfoImpl.java:151)
        at com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl$1.serializeBody(ElementBeanInfoImpl.java:185)
        at com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl.serializeBody(ElementBeanInfoImpl.java:305)
        at com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl.serializeRoot(ElementBeanInfoImpl.java:312)
        at com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl.serializeRoot(ElementBeanInfoImpl.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.java:644)

      Attachments

        1. jms-sdodatabinding.zip
          22 kB
          Raman Grover

        Activity

          People

            Unassigned Unassigned
            raman Raman Grover
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: