ClassCastException, incompatible with Collection 
-------------------------------------------------

                 Key: AXIS2-2419
                 URL: https://issues.apache.org/jira/browse/AXIS2-2419
             Project: Axis 2.0 (Axis2)
          Issue Type: Bug
          Components: jaxws
            Reporter: Nikhil Thaker
         Assigned To: Nikhil Thaker


The following ClassCastException is being thrown with several 
variations when a wsdl schema includes SimpleType with xsd:list.

Variations:
ClassCastException: [Ljava.lang.String; incompatible with java.util.Collection
ClassCastException: [Ljava.lang.Integer; incompatible with java.util.Collection
ClassCastException: [Ljava.lang.Float; incompatible with java.util.Collection
ClassCastException: [Ljava.math.BigDecimal; incompatible with 
java.util.Collection
ClassCastException: [Ljava.lang.Double; incompatible with java.util.Collection
ClassCastException: [Ljava.math.BigInteger; incompatible with 
java.util.Collection
ClassCastException: [Ljava.lang.Long; incompatible with java.util.Collection
ClassCastException: [Ljava.lang.Short; incompatible with java.util.Collection
ClassCastException: [Ljava.lang.Byte; incompatible with java.util.Collection

javax.xml.ws.WebServiceException: java.lang.ClassCastException: 
[Ljava.lang.String; incompatible with
java.util.Collection
        at 
org.apache.axis2.jaxws.ExceptionFactory.createWebServiceException(ExceptionFactory.java:179)
        at 
org.apache.axis2.jaxws.ExceptionFactory.makeWebServiceException(ExceptionFactory.java:79)
        at 
org.apache.axis2.jaxws.ExceptionFactory.makeWebServiceException(ExceptionFactory.java:133)
        at 
org.apache.axis2.jaxws.message.databinding.impl.JAXBBlockImpl.marshalByElement(JAXBBlockImpl.java:259)
        at 
org.apache.axis2.jaxws.message.databinding.impl.JAXBBlockImpl._outputFromBO(JAXBBlockImpl.java:208)
        at 
org.apache.axis2.jaxws.message.impl.BlockImpl.outputTo(BlockImpl.java:319)
        at 
org.apache.axis2.jaxws.message.impl.BlockImpl.serialize(BlockImpl.java:248)
        at 
org.apache.axiom.om.impl.llom.OMSourcedElementImpl.internalSerializeAndConsume(OMSourcedElementImpl.java:574)
        at 
org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:819)
        at 
org.apache.axiom.om.impl.llom.OMElementImpl.internalSerializeAndConsume(OMElementImpl.java:848)
        at 
org.apache.axiom.soap.impl.llom.SOAPEnvelopeImpl.serializeInternally(SOAPEnvelopeImpl.java:223)
        at 
org.apache.axiom.soap.impl.llom.SOAPEnvelopeImpl.internalSerialize(SOAPEnvelopeImpl.java:211)
        at 
org.apache.axiom.om.impl.llom.OMElementImpl.internalSerializeAndConsume(OMElementImpl.java:848)
        at 
org.apache.axiom.om.impl.llom.OMNodeImpl.serializeAndConsume(OMNodeImpl.java:419)
        at 
org.apache.axis2.transport.http.SOAPMessageFormatter.getBytes(SOAPMessageFormatter.java:77)
        at 
com.ibm.ws.websvcs.transport.http.SOAPOverHTTPSender.prepareHttpRequestHeaders(SOAPOverHTTPSender.java:1859)
        at 
com.ibm.ws.websvcs.transport.http.SOAPOverHTTPSender.sendSOAPRequest(SOAPOverHTTPSender.java:478)
        at 
com.ibm.ws.websvcs.transport.http.SOAPOverHTTPSender.send(SOAPOverHTTPSender.java:388)
        at 
com.ibm.ws.websvcs.transport.http.HTTPTransportSender.invoke(HTTPTransportSender.java:238)
        at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:486)
        at 
org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:325)
        at 
org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.java:289)
        at 
org.apache.axis2.jaxws.core.controller.AxisInvocationController.execute(AxisInvocationController.java:547)
        at 
org.apache.axis2.jaxws.core.controller.AxisInvocationController.doInvoke(AxisInvocationController.java:110)
        at 
org.apache.axis2.jaxws.core.controller.InvocationController.invoke(InvocationController.java:97)
        at 
org.apache.axis2.jaxws.client.proxy.JAXWSProxyHandler.invokeSEIMethod(JAXWSProxyHandler.java:265)
        at 
org.apache.axis2.jaxws.client.proxy.JAXWSProxyHandler.invoke(JAXWSProxyHandler.java:142)
        at $Proxy9.echoStringListTypeTest(Unknown Source)
        at 
com.sun.ts.tests.jaxws.ee.w2j.document.literal.marshalltest.Client.StringListTest(Client.java:3289)
        at 
com.sun.ts.tests.jaxws.ee.w2j.document.literal.marshalltest.Client.MarshallListTypesTest(Client.java:1274)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:615)
        at com.sun.ts.lib.harness.EETest.run(EETest.java:495)
        at com.sun.ts.lib.harness.ServiceEETest.run(ServiceEETest.java:112)
        at 
com.sun.ts.tests.common.vehicle.EmptyVehicleRunner.run(EmptyVehicleRunner.java:30)
        at com.sun.ts.lib.harness.ServiceEETest.run(ServiceEETest.java:102)
        at com.sun.ts.lib.harness.EETest.getPropsReady(EETest.java:392)
        at com.sun.ts.lib.harness.ServiceEETest.run(ServiceEETest.java:209)
        at com.sun.ts.lib.harness.EETest.run(EETest.java:204)
        at 
com.sun.ts.tests.common.vehicle.VehicleClient.main(VehicleClient.java:27)
Caused by: java.lang.ClassCastException: [Ljava.lang.String; incompatible with 
java.util.Collection
        at 
com.sun.xml.bind.v2.runtime.reflect.Lister$CollectionLister.iterator(Lister.java:221)
        at 
com.sun.xml.bind.v2.runtime.reflect.ListTransducedAccessorImpl.print(ListTransducedAccessorImpl.java:71)
        at 
com.sun.xml.bind.v2.runtime.reflect.DefaultTransducedAccessor.writeLeafElement(DefaultTransducedAccessor.java:29)
        at 
com.sun.xml.bind.v2.runtime.property.ListElementProperty.serializeBody(ListElementProperty.java:73)
        at 
com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl$1.serializeBody(ElementBeanInfoImpl.java:98)
        at 
com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl$1.serializeBody(ElementBeanInfoImpl.java:127)
        at 
com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl.serializeBody(ElementBeanInfoImpl.java:244)
        at 
com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl.serializeRoot(ElementBeanInfoImpl.java:251)
        at 
com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl.serializeRoot(ElementBeanInfoImpl.java:33)
        at 
com.sun.xml.bind.v2.runtime.XMLSerializer.childAsRoot(XMLSerializer.java:455)
        at 
com.sun.xml.bind.v2.runtime.MarshallerImpl.write(MarshallerImpl.java:292)
        at 
com.sun.xml.bind.v2.runtime.MarshallerImpl.marshal(MarshallerImpl.java:148)
        at 
org.apache.axis2.jaxws.message.databinding.impl.JAXBBlockImpl.marshalByElement(JAXBBlockImpl.java:257)
        ... 38 more

I will attach a fix for this issue.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to