Hi Linus,

Some thoughts and ideas...

Is it possible you're somehow getting two copies of the 
edu.iris.ws.core.Event class in your server classpath (perhaps with an 
old jar still left in place)? ClassCastException always confuses me, but 
it looks like it's saying that the the error is occurring when trying to 
cast an edu.iris.ws.core.Event to something - and the only thing the 
binding should be casting to is an edu.iris.ws.core.Event. It would 
certainly have made this exception easier to interpret if the great 
all-fathers of Java at Sun had seen fit to add the type being casted 
*to* to the exception message.

Have you tried dropping back to the Event[] return since this problem 
came up? If you can still return Event[] properly it sounds like it's 
something deeper in the binding code.

And just to be clear, you're *not* using the unwrapping (-uw) option for 
Axis2 WSDL2Java, right? Which version of Axis2 and the JiBX code are you 
using?

  - Dennis

Dennis M. Sosnoski
SOA and Web Services in Java
Training and Consulting
http://www.sosnoski.com - http://www.sosnoski.co.nz
Seattle, WA +1-425-939-0576 - Wellington, NZ +64-4-298-6117



Linus Kamb wrote:
> I apologize if this is obvious.  I'm sort of jumping back in to the 
> thick of things without much warmup.
>
> It seems like what I am doing is fairly straight-forward, but I am 
> getting a ClassCast on the server side after my server method returns, 
> so I am having a hard time diagnosing.
>
> I am trying to return a complex object that includes a Long "key" and a 
> collection of "Event" objects.  Returning the array of Event objects 
> worked just fine.  Switching to the compound return object is proving 
> more difficult than I would have imagined.
>
> Relevant bits extracted from their respective files are:
>
> from the WSDL:
>
>             <complexType name="PhaseQueryReturnType">
>                 <sequence>
>                     <element name="key" type="long" minOccurs="0" 
> nillable="true"/>
>                     <element name="event" type="ws:EventType" 
> minOccurs="0" maxOccurs="unbounded"/>
>                 </sequence>
>             </complexType>
>             <element name="phasePickQueryResponse"> // ouput message of 
> the phasePickQuery service operation
>                 <complexType>
>                     <sequence>
>                         <element type="phase:PhaseQueryReturnType"  
> minOccurs="0" name="response" />
>                     </sequence>
>                 </complexType>
>             </element>
>            
> from the binding file:
>
>     <mapping type-name="phase:PhaseQueryReturnType" 
> class="edu.iris.ws.phasepick.PhasePickQueryReturn" abstract="true" >
>         <value name="key" field="iteratorKey" usage="optional" />
>         <collection field="events" item-type="edu.iris.ws.core.Event" />
>     </mapping>
>
> I don't know what else would be helpful to see.   The various other bits 
> are scattered around in numerous other xsd and binding files, which all 
> worked prior to my jigging with it.  It seems like I must be doing 
> something wrong with the collection definition.  I've tried having the 
> PhaseQueryReturn type contain the Events as an ArrayList or simply as 
> Event[].
>
> Previously, the phasePickQueryResponse element simply contained the 
> array of ws:EventType elements, and the service operation returned 
> edu.iris.ws.core.Event[];
>
> I managed at least to get a stack dump out of Axis2:
> 2007-07-30 16:28:26,893 ERROR AxisServlet.doPost.157  - 
> java.lang.ClassCastException: edu.iris.ws.core.Event
> java.lang.ClassCastException: edu.iris.ws.core.Event
>     at edu.iris.ws.base.JiBX_MungeAdapter.JiBX_binding_marshal_1_7()
>     at 
> edu.iris.ws.phasepick.PhasePickQueryReturn.JiBX_binding_marshal_1_0(Unknown 
> Source)
>     at 
> edu.iris.ws.phasepick.JiBX_bindingPhasePickQueryReturn_access.marshal()    
> at org.apache.axis2.jibx.JiBXDataSource.marshal(JiBXDataSource.java:131)
>     at 
> org.apache.axis2.jibx.JiBXDataSource.serialize(JiBXDataSource.java:177)
>     at 
> org.apache.axiom.om.impl.llom.OMSourcedElementImpl.internalSerializeAndConsume(OMSourcedElementImpl.java:583)
>     at 
> org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:779)
>     at 
> org.apache.axiom.om.impl.llom.OMElementImpl.internalSerializeAndConsume(OMElementImpl.java:808)
>     at 
> org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:779)
>     at 
> org.apache.axiom.om.impl.llom.OMElementImpl.internalSerializeAndConsume(OMElementImpl.java:808)
>     
> at 
> org.apache.axiom.soap.impl.llom.SOAPEnvelopeImpl.serializeInternally(SOAPEnvelopeImpl.java:234)
>     
> at 
> org.apache.axiom.soap.impl.llom.SOAPEnvelopeImpl.internalSerialize(SOAPEnvelopeImpl.java:222)
>     at 
> org.apache.axiom.om.impl.llom.OMElementImpl.internalSerializeAndConsume(OMElementImpl.java:808)
>     at 
> org.apache.axiom.om.impl.llom.OMNodeImpl.serializeAndConsume(OMNodeImpl.java:418)
>     at 
> org.apache.axis2.transport.http.SOAPMessageFormatter.writeTo(SOAPMessageFormatter.java:55)
>     at 
> org.apache.axis2.transport.http.CommonsHTTPTransportSender.sendUsingOutputStream(CommonsHTTPTransportSender.java:275)
>     at 
> org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:203)
>     at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:452)
>     at 
> org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver.receive(AbstractInOutSyncMessageReceiver.java:48)
>     
> at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:144)
>     at 
> org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:279)
>     at 
> org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:116)
>     at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)    
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>     at 
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
>     at 
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
>     
> at 
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210)
>     
> at 
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
>     at 
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
>     at 
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117) 
>    
> at 
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
>     
> at 
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
>     at 
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:870)
>     at 
> org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
>     at 
> org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
>     at 
> org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
>     
> at 
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685)
>     at java.lang.Thread.run(Thread.java:613)
>
>
> Thoughts? Pointers? Ideas?
>
> thanks,
> Linus
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc.
> Still grepping through log files to find problems?  Stop.
> Now Search log events and configuration files using AJAX and a browser.
> Download your FREE copy of Splunk now >>  http://get.splunk.com/
> _______________________________________________
> jibx-users mailing list
> jibx-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jibx-users
>
>   

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users

Reply via email to