I am working on axis2 1.5.1 version with the JIXB. I have developed a
web-service and binding’s objects with the help of these technologies, I
follow JIXB BindGen approach to get the xsd and binding.xml for the existing
Java objects.

 

Now, when I am trying to send a request from the soapUI tool, at the server
side I encountered below exception

 

Caused by: java.lang.ClassCastException:
org.apache.axiom.om.impl.llom.OMElementI

mpl cannot be cast to
com.contactual.provisioning.spmlschema.CapabilityDataType

        at
com.contactual.provisioning.services.entities.request.handler.AgentAdd

RequestHandler.handleRequest(AgentAddRequestHandler.java:29)

        at
com.contactual.provisioning.spmlschema.request.handler.AddRequestHandl

er.handleSyncRequest(AddRequestHandler.java:80)

        at
com.contactual.provisioning.spmlschema.request.handler.RequestHandlerB

ase.handleRequest(RequestHandlerBase.java:26)

        at
com.contactual.provisioning.services.ProvisioningImpl.addRequest(Provi

sioningImpl.java:53)

        at
com.contactual.provisioning.api.ProvisioningAPI.addRequest(Provisionin

gAPI.java:38)

        ... 31 more

15:40:33,411 INFO  [STDOUT] 2010-04-22 15:40:33,411 ERROR
[org.apache.axis2.engin

e.AxisEngine] - org.apache.axiom.om.impl.llom.OMElementImpl cannot be cast
to com

.contactual.provisioning.spmlschema.CapabilityDataType

org.apache.axis2.AxisFault: org.apache.axiom.om.impl.llom.OMElementImpl
cannot be

 cast to com.contactual.provisioning.spmlschema.CapabilityDataType

        at
org.apache.axis2.rpc.receivers.RPCMessageReceiver.invokeBusinessLogic(

RPCMessageReceiver.java:158)

        at
org.apache.axis2.receivers.AbstractInOutMessageReceiver.invokeBusiness

Logic(AbstractInOutMessageReceiver.java:40)

        at
org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMes

sageReceiver.java:114)

        at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:173)

        at
org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequ

est(HTTPTransportUtils.java:167)

        at
org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:14

2)

        at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)

 

 

Basically, client request contains a complex type which is collection (list)
of some objects, at the server end when I am trying to fetch the specific
object from the LIST, instead of getting that specific object for the XML, I
am getting OMElement type object.

 

Following is the section of XSD, defining my complex object

 

<complexType name="CapabilityDataType">

<complexContent>

            <extension base="spml:ExtensibleType">

                  <annotation>

                        <documentation>Contains capability specific
elements.

                        </documentation>

                  </annotation>

                  <attribute name="mustUnderstand" type="xsd:boolean"
use="optional" />

                  <attribute name="capabilityURI" type="xsd:anyURI" />

            </extension>

      </complexContent>

</complexType>

 

soapUI request contains below section

 

<xsd:capabilityDatas>

            <xsd:CapabilityDataType  mustUnderstand="true"
capabilityURI="http://abc.vom"; />

            <xsd:CapabilityDataType  mustUnderstand="false"
capabilityURI="http://abc1.vom"; />

</xsd:capabilityDatas>

 

Java Code

public ExtensibleType handleRequest(String psoId, String containerId,
ExtensibleType data,

                  List<CapabilityDataType> capabilityDatas) {

            logging.debug("AgentAddRequestHandler handleRequest()....");

            CapabilityDataType capType = capabilityDatas.get(0); (At this
line exception was thrown)

 

On many forums, users/developers suggested using Array of objects instead of
List, but it too didn’t work. Please help me, if any one is familiar with
the issue and the way to resolve it.

Let me know if you need any more information from my end

Regards,
Sourabh Jain
-- 
View this message in context: 
http://old.nabble.com/Caused-by%3A-java.lang.ClassCastException%3A-org.apache.axiom.om.impl.llom.OMElementI-tp28328825p28328825.html
Sent from the Axis - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscr...@axis.apache.org
For additional commands, e-mail: java-user-h...@axis.apache.org

Reply via email to