java.lang.ClassCastException when ejecuting a class generated by wsdl2java

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

java.lang.ClassCastException when ejecuting a class generated by wsdl2java

acano
Hi I am haven an java.lang.ClassCastException  when ejecuting a class generated by wsdl2java.

The code and line where I am obtainning that error is written bellow. Could someone help me and tell me if he knows from where the excemption comes. In my opion all is fine. Thanks!

___


public interface PutMessageDocument extends org.apache.xmlbeans.XmlObject
{
    public static final org.apache.xmlbeans.SchemaType type =
(org.apache.xmlbeans.SchemaType)
        org.apache.xmlbeans.XmlBeans.typeSystemForClassLoader(PutMessageDocument.class.getClassLoader(),
"schemaorg_apache_xmlbeans.system.sC7817EF2F2276EF2D88DA3EC1AD8DF81").resolveHandle("putmessage2e79doctype");
.
.
.
.
.
    public static final class Factory
    {
        public static
org.starstandards.www.webservices._2005._10.transport.PutMessageDocument
newInstance() {
        org.apache.xmlbeans.XmlObject instXmlObject =
org.apache.xmlbeans.XmlBeans.getContextTypeLoader().newInstance( type,
null ) ;
ERROR>>>        PutMessageDocument instPutMessageDocument = (PutMessageDocument)
instXmlObject;
        return  instPutMessageDocument;
        }
.
.
.
.

The error shown is:
25-oct-2010 7:46:55 Exception java.lang.ClassCastException:
org.apache.xmlbeans.impl.values.XmlComplexContentImpl
java.lang.ClassCastException:
org.apache.xmlbeans.impl.values.XmlComplexContentImpl
        at
org.starstandards.www.webservices._2005._10.transport.PutMessageDocument$Factory.newInstance(PutMessageDocument.java:99)
        at
ProcessRepairOrderCalling.callTranmitWarrantyClaim(ProcessRepairOrderCalling.java:146)
        at ProcessRepairOrderCalling.main(ProcessRepairOrderCalling.java:463)
25-oct-2010 7:46:55 End of calling main
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: java.lang.ClassCastException when ejecuting a class generated by wsdl2java

vijender
I'm facing the similar issue using apache axis 2.0.

How did you resolve this issue regarding the "Class cast exception" in xmlbeans.

We are getting the issue with axis2 1.4 version.

java code is generated from the WSDL using axis2 1.4 from command line.

We are using "rampart" security module also.


error log:


[Loaded org.apache.xmlbeans.impl.store.Xobj$DetailXobj from file:/C:/svn/trunk/build/target/ivy/repo-cache/apache/xmlbeans/jars/xmlbeans-2.3.0.jar]
[Loaded org.apache.xmlbeans.impl.soap.DetailEntry from file:/C:/svn/trunk/build/target/ivy/repo-cache/apache/xmlbeans/jars/xmlbeans-2.3.0.jar]
[Loaded org.apache.xmlbeans.impl.store.Xobj$DetailEntryXobj from file:/C:/svn/trunk/build/target/ivy/repo-cache/apache/xmlbeans/jars/xmlbeans-2.3.0.jar]
[Loaded org.apache.xmlbeans.impl.soap.SOAPFault from file:/C:/svn/trunk/build/target/ivy/repo-cache/apache/xmlbeans/jars/xmlbeans-2.3.0.jar]
[Loaded org.apache.xmlbeans.impl.store.Xobj$SoapFaultXobj from file:/C:/svn/trunk/build/target/ivy/repo-cache/apache/xmlbeans/jars/xmlbeans-2.3.0.jar]
[Loaded org.apache.xmlbeans.impl.store.Xobj$AttrXobj from file:/C:/svn/trunk/build/target/ivy/repo-cache/apache/xmlbeans/jars/xmlbeans-2.3.0.jar]
[Loaded org.apache.xmlbeans.impl.store.Xobj$CommentXobj from file:/C:/svn/trunk/build/target/ivy/repo-cache/apache/xmlbeans/jars/xmlbeans-2.3.0.jar]
[Loaded org.apache.xmlbeans.impl.values.XmlComplexContentImpl from file:/C:/svn/trunk/build/target/ivy/repo-cache/apache/xmlbeans/jars/xmlbeans-2.3.0.jar]
java.lang.ClassCastException: org.apache.xmlbeans.impl.values.XmlComplexContentImpl cannot be cast to com.exacttarget.wsdl.partnerapi.TriggeredSendDefinition
        at com.exacttarget.wsdl.partnerapi.TriggeredSendDefinition$Factory.newInstance(TriggeredSendDefinition.java:834)
        at com.gap.gid.emailservice.adapter.ETEmailServiceAdapter.create(ETEmailServiceAdapter.java:105)
        at com.gap.gid.ecom.process.profile.EmailSubscriptionRequestCoordinator.execute(EmailSubscriptionRequestCoordinator.java:29)
        at com.gap.gid.ecom.action.profile.EmailSubscriptionRequestAction.execute(EmailSubscriptionRequestAction.java:43)
        at com.gap.gid.ecom.action.BaseAction.execute(BaseAction.java:534)
        at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
        at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
        at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
        at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
Loading...