3 Replies Latest reply on Jan 5, 2006 4:21 AM by Thomas Diesler

    String[][] deserialization error

    mie takahashi Newbie

      Hi

      I am new to JBoss. I tried WSRPCServiceStepByStep and it worked ok.
      I added String[][] element to the Person class with the appropriate
      setters and getters and got the following exception ...

      14:51:58,156 ERROR [RPCInvocation] org.xml.sax.SAXException: SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize.
      org.xml.sax.SAXException: SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize.
      at org.jboss.axis.encoding.ser.SimpleDeserializer.onStartChild(SimpleDeserializer.java:206)
      at org.jboss.axis.encoding.DeserializationContextImpl.startElement(DeserializationContextImpl.java:1168)
      at org.jboss.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:244)
      at org.jboss.axis.message.SOAPElementAxisImpl.publishToHandler(SOAPElementAxisImpl.java:1386)
      at org.jboss.axis.message.RPCElement.deserialize(RPCElement.java:262)
      at org.jboss.axis.message.RPCElement.getParams(RPCElement.java:396)
      at org.jboss.axis.providers.java.RPCInvocation.prepareFromRequestEnvelope(RPCInvocation.java:235)
      at org.jboss.axis.providers.java.RPCProvider.processMessage(RPCProvider.java:103)
      at org.jboss.axis.providers.java.JavaProvider.invoke(JavaProvider.java:358)
      at org.jboss.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:73)
      at org.jboss.axis.SimpleChain.doVisiting(SimpleChain.java:160)
      at org.jboss.axis.SimpleChain.invoke(SimpleChain.java:123)
      at org.jboss.axis.handlers.soap.SOAPService.invoke(SOAPService.java:560)
      at org.jboss.webservice.server.ServerEngine.invokeInternal(ServerEngine.java:200)
      at org.jboss.webservice.server.ServerEngine.invoke(ServerEngine.java:89)
      at org.jboss.axis.transport.http.AxisServlet.doPost(AxisServlet.java:905)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
      at org.jboss.axis.transport.http.AxisServletBase.service(AxisServletBase.java:370)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
      at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
      at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:153)
      at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
      at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
      at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
      at java.lang.Thread.run(Thread.java:534)

      I deployed Organization.war which contains the following:
      ? web.xml
      ? webservices.xml
      ? jax-rpcmapping.xml
      ? OrganizationService.wsdl
      ? appropriate class files

      I didn't change any outputs created by wscompile.

      Do I have to add extra mapping information for String[][] to jax-rpcmapping.xml?
      wscompile created
      "org.jboss.test.webservice.sample._arrays.java.lang.StringArray" class for String[] automatically.
      Any relation to this?

      or Is it any relations to the JBWS-264 bug which reported byte[][] bug....?

      Any information will be appreciated.

      -Mie




        • 2. Re:  String[][] deserialization error
          mie takahashi Newbie

          Hi Thomas,

          Thank you for your advise.
          I read the WSArrayTypeMapping WIKI site as you suggested.
          However, I am still getting the same error...

          The example is showing how to return the array of user defined
          class without array variables. I want to get and return user defined class
          with 2 dimensional array variable(Sring[][]) through WS.


          I added the following code to jax-rpcmapping.xml

          <java-xml-type-mapping>
          <java-type>org.jboss.test.webservice.samples.Person</java-type>
          <root-type-qname xmlns:typeNS="http://org.jboss.test.webservice/samples/types">typeNS:Person</root-type-qname>
          <qname-scope>complexType</qname-scope>
          <variable-mapping>
          <java-variable-name>items</java-variable-name>
          <xml-element-name>items</xml-element-name>
          </variable-mapping>
          <variable-mapping>
          <java-variable-name>name</java-variable-name>
          <xml-element-name>name</xml-element-name>
          </variable-mapping>
          </java-xml-type-mapping>
          
          <!-- FROM HERE added StringArray type mapping -->
          <java-xml-type-mapping>
          <java-type>org.jboss.test.webservice.samples._arrays.java.lang.StringArray</java-type>
          <root-type-qname xmlns:typeNS="http://org.jboss.test.webservice/samples/types/arrays/java/lang">typeNS:StringArray</root-type-qname>
          <qname-scope>complexType</qname-scope>
          </java-xml-type-mapping>
          <!-- TO HERE added StringArray type mapping -->
          
          



          The is the wsdl file
          <types>
          <schema targetNamespace="http://org.jboss.test.webservice/samples/types/arrays/java/lang" ...>
          <import namespace="http://org.jboss.test.webservice/samples/types" />
          <complexType name="StringArray">
          <sequence>
          <element maxOccurs="unbounded" minOccurs="0" name="value" nillable="true" type="string" />
          </sequence>
          </complexType>
          </schema>
          <schema targetNamespace="http://org.jboss.test.webservice/samples/types" ...>
          <import namespace="http://org.jboss.test.webservice/samples/types/arrays/java/lang" />
          <complexType name="Person">
          <sequence>
          <element maxOccurs="unbounded" minOccurs="0" name="items" type="ns2:StringArray" />
          <element name="name" nillable="true" type="string" />
          </sequence>
          </complexType>
          </schema>
          </types>
          


          This is the SEI
          public interface Organization extends Remote{
           String getContactInfo(String organization) throws RemoteException;
           Person jobRequestPerson(Person target) throws RemoteException;
          
          }
          


          This is the Person class which has String[][] variable
          public class Person{
           private String name;
           private String[][] items;
          
           public Person(){}
          
           public Person(String n){
           name = n;
           }
          
           public String[][] getItems() {
           return items;
           }
          
           public void setItems(String[][] items) {
           this.items = items;
           }
          
           public String getName(){
           return name;
           }
          
           public void setName(String name){
           this.name = name;
           }
           }
          


          Please help me to get this work....

          -Mie