Hello,
I’ve put together a fairly simple derivative of the “Hello World CORBA Demo”
(specifically “Use Case 3 - CXF/JAX-WS Server, CXF/JAX-WS Client”) which
may be showing a defect.
This began as a rather large, complicated corba idl from an external vender
which I converted to wsdl using the cxf idl2wsdl utility. Testing this
using a simple CXF/JAX-WS Server and CXF/JAX-WS Client, one particular
operation produced the exception “org.apache.cxf.interceptor.Fault:
Unmarshalling Error: null” on the server. After verifying that all objects
were getting fully initialized by the client without any nulls, I began
paring away everything from the wsdl that wasn’t pertinent to this
particular scenario.
What I’ve found is that given the following types, a HelloWorld message
works if the inparameter is of type “MyItem” but not for “MyItemVector”.
<xs:complexType name="MyItem">
<xs:sequence>
<xs:element name="newMyString" type=" xs:string"></xs:element>
</xs:sequence>
</xs:complexType>
<xs:complexType name="MyItemVector">
<xs:sequence>
<xs:element maxOccurs="1000" minOccurs="0" name="item"
type="MyItem"></xs:element>
</xs:sequence>
</xs:complexType>
So based upon these findings, I’ve attached a HelloWorld project that
hopefully will make reproducing this behavior fairly easy. (Note: I’ve only
included the wsdl—not the original idl. I can produce that as well if this
would help.) I’ve reproduced this on XP as well as HPUX and using both
cxf-2.2.9 and the cxf-2.3.0-SNAPSHOT and I’ve been using java6 and Sun’s
orbd.
To reproduce
1. Untar ApacheCxfProblem.tar
http://cxf.547215.n5.nabble.com/file/n2266930/ApacheCxfProblem.tar
ApacheCxfProblem.tar
2. Configure ApacheCxfProblem/config/.profile
export PROJECT_HOME=<full path>/ApacheCxfProblem
export CXF_HOME=<full path>/apache-cxf-2.2.9
3. From the ApacheCxfProblem/bin directory execute
. ../config/.profile
./runns.sh
./runserver.sh
./runclient.sh
Thanks,
Andrew
Here is a snippet of my client code:
SayingHelloCORBAService s = new SayingHelloCORBAService();
SayingHello client = s.getSayingHelloCORBAPort();
MyItem item = new MyItem();
item.setNewMyString( "6010" );
MyItemVector vector = new MyItemVector();
vector.getItem().add( item );
System.out.println("Invoking greetMe... ");
String result = client.helloWorld( vector );
System.out.println("greetMe.result=" + result);
And resulting stack trace on the server:
org.apache.cxf.interceptor.Fault: Unmarshalling Error: null
at
org.apache.cxf.jaxb.JAXBEncoderDecoder.unmarshall(JAXBEncoderDecoder.java:780)
at
org.apache.cxf.jaxb.JAXBEncoderDecoder.unmarshall(JAXBEncoderDecoder.java:624)
at
org.apache.cxf.jaxb.io.DataReaderImpl.read(DataReaderImpl.java:128)
at
org.apache.cxf.interceptor.BareInInterceptor.handleMessage(BareInInterceptor.java:138)
at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:243)
at
org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:110)
at
org.apache.cxf.binding.corba.runtime.CorbaDSIServant.invoke(CorbaDSIServant.java:175)
at
com.sun.corba.se.impl.protocol.CorbaServerRequestDispatcherImpl.dispatchToServant(CorbaServerRequestDispatcherImpl.java:626)
at
com.sun.corba.se.impl.protocol.CorbaServerRequestDispatcherImpl.dispatch(CorbaServerRequestDispatcherImpl.java:189)
at
com.sun.corba.se.impl.protocol.CorbaMessageMediatorImpl.handleRequestRequest(CorbaMessageMediatorImpl.java:1682)
at
com.sun.corba.se.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:1540)
at
com.sun.corba.se.impl.protocol.CorbaMessageMediatorImpl.handleInput(CorbaMessageMediatorImpl.java:922)
at
com.sun.corba.se.impl.protocol.giopmsgheaders.RequestMessage_1_2.callback(RequestMessage_1_2.java:181)
at
com.sun.corba.se.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:694)
at
com.sun.corba.se.impl.transport.SocketOrChannelConnectionImpl.dispatch(SocketOrChannelConnectionImpl.java:451)
at
com.sun.corba.se.impl.transport.SocketOrChannelConnectionImpl.doWork(SocketOrChannelConnectionImpl.java:1213)
at
com.sun.corba.se.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.performWork(ThreadPoolImpl.java:471)
at
com.sun.corba.se.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.run(ThreadPoolImpl.java:500)
Caused by: java.lang.NullPointerException
at
org.apache.cxf.binding.corba.runtime.CorbaStreamReader.getTextCharacters(CorbaStreamReader.java:49)
at
com.sun.xml.bind.v2.runtime.unmarshaller.StAXStreamConnector.handleCharacters(StAXStreamConnector.java:323)
at
com.sun.xml.bind.v2.runtime.unmarshaller.StAXStreamConnector.bridge(StAXStreamConnector.java:187)
at
com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:360)
at
com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:339)
at
org.apache.cxf.jaxb.JAXBEncoderDecoder.unmarshall(JAXBEncoderDecoder.java:755)
... 17 more
--
View this message in context:
http://cxf.547215.n5.nabble.com/Corba-Use-Case-CXF-JAX-WS-Server-and-CXF-JAX-WS-Client-with-corba-sequence-produces-Unmarshalling-Erl-tp2266930p2266930.html
Sent from the cxf-issues mailing list archive at Nabble.com.