6 Replies Latest reply on May 4, 2006 5:30 AM by Thomas Diesler

    Custom type: org.jboss.ws.WSException

    Juergen Zimmermann Master

      I'm using JBoss 4.0.4CR2 with EJB3 enabled.

      My webservice has a method using a custom type (a JavaBean on the server side). The client throws a stack trace (see below). What should I do? What's going wrong?

      The WSDL looks as follows:

      <?xml version="1.0" encoding="UTF-8"?>
      <definitions name='KundenverwaltungWSBeanService' targetNamespace='http://ws.hska.de/jaws' xmlns='http://schemas.xmlsoap.org/wsdl/' xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/' xmlns:tns='http://ws.hska.de/jaws' xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
       <types>
       <schema elementFormDefault='qualified' targetNamespace='http://ws.hska.de/jaws' xmlns='http://www.w3.org/2001/XMLSchema' xmlns:soap11-enc='http://schemas.xmlsoap.org/soap/encoding/' xmlns:tns='http://ws.hska.de/jaws' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
       <complexType name='KundeWS'>
       <sequence>
       <element name='art' nillable='true' type='string'/>
       <element name='id' type='long'/>
       <element name='nachname' nillable='true' type='string'/>
       <element name='rabatt' type='int'/>
       <element name='vorname' nillable='true' type='string'/>
       </sequence>
       </complexType>
       </schema>
       </types>
       <message name='KundenverwaltungWSBean_deleteKunde'>
       <part name='long_1' type='xsd:long'/>
       </message>
       <message name='KundenverwaltungWSBean_deleteKundeResponse'/>
       <message name='KundenverwaltungWSBean_findKunde'>
       <part name='long_1' type='xsd:long'/>
       </message>
       <message name='KundenverwaltungWSBean_findKundeResponse'>
       <part name='result' type='tns:KundeWS'/>
       </message>
       <message name='KundenverwaltungWSBean_findNachname'>
       <part name='long_1' type='xsd:long'/>
       </message>
       <message name='KundenverwaltungWSBean_findNachnameResponse'>
       <part name='result' type='xsd:string'/>
       </message>
       <portType name='KundenverwaltungWSBean'>
       <operation name='deleteKunde' parameterOrder='long_1'>
       <input message='tns:KundenverwaltungWSBean_deleteKunde'/>
       <output message='tns:KundenverwaltungWSBean_deleteKundeResponse'/>
       </operation>
       <operation name='findKunde' parameterOrder='long_1'>
       <input message='tns:KundenverwaltungWSBean_findKunde'/>
       <output message='tns:KundenverwaltungWSBean_findKundeResponse'/>
       </operation>
       <operation name='findNachname' parameterOrder='long_1'>
       <input message='tns:KundenverwaltungWSBean_findNachname'/>
       <output message='tns:KundenverwaltungWSBean_findNachnameResponse'/>
       </operation>
       </portType>
       <binding name='KundenverwaltungWSBeanBinding' type='tns:KundenverwaltungWSBean'>
       <soap:binding style='rpc' transport='http://schemas.xmlsoap.org/soap/http'/>
       <operation name='deleteKunde'>
       <soap:operation soapAction=''/>
       <input>
       <soap:body namespace='http://ws.hska.de/jaws' use='literal'/>
       </input>
       <output>
       <soap:body namespace='http://ws.hska.de/jaws' use='literal'/>
       </output>
       </operation>
       <operation name='findKunde'>
       <soap:operation soapAction=''/>
       <input>
       <soap:body namespace='http://ws.hska.de/jaws' use='literal'/>
       </input>
       <output>
       <soap:body namespace='http://ws.hska.de/jaws' use='literal'/>
       </output>
       </operation>
       <operation name='findNachname'>
       <soap:operation soapAction=''/>
       <input>
       <soap:body namespace='http://ws.hska.de/jaws' use='literal'/>
       </input>
       <output>
       <soap:body namespace='http://ws.hska.de/jaws' use='literal'/>
       </output>
       </operation>
       </binding>
       <service name='KundenverwaltungWSBeanService'>
       <port binding='tns:KundenverwaltungWSBeanBinding' name='KundenverwaltungWSBeanPort'>
       <soap:address location='REPLACE_WITH_ACTUAL_URL'/>
       </port>
       </service>
      </definitions>
      


      And now the stack trace:
      org.jboss.ws.WSException: Cannot obtain java type mapping for: {http://ws.hska.de/jaws}KundeWS
       at org.jboss.ws.metadata.JSR109MetaDataBuilder.buildParameterMetaDataRpc(JSR109MetaDataBuilder.java:314)
       at org.jboss.ws.metadata.JSR109MetaDataBuilder.setupOperationsFromWSDL(JSR109MetaDataBuilder.java:189)
       at org.jboss.ws.metadata.JSR109ClientMetaDataBuilder.buildMetaDataInternal(JSR109ClientMetaDataBuilder.java:213)
       at org.jboss.ws.metadata.JSR109ClientMetaDataBuilder.buildMetaData(JSR109ClientMetaDataBuilder.java:89)
       at org.jboss.ws.jaxrpc.ServiceImpl.<init>(ServiceImpl.java:89)
       at org.jboss.ws.jaxrpc.ServiceFactoryImpl.createService(ServiceFactoryImpl.java:157)
       at org.jboss.ws.jaxrpc.ServiceFactoryImpl.createService(ServiceFactoryImpl.java:128)
       at de.hska.ws.client.Main.main(Main.java:22)
      --- Nested Exception ---
      org.jboss.ws.WSException: Cannot obtain java type mapping for: {http://ws.hska.de/jaws}KundeWS
       at org.jboss.ws.metadata.JSR109MetaDataBuilder.buildParameterMetaDataRpc(JSR109MetaDataBuilder.java:314)
       at org.jboss.ws.metadata.JSR109MetaDataBuilder.setupOperationsFromWSDL(JSR109MetaDataBuilder.java:189)
       at org.jboss.ws.metadata.JSR109ClientMetaDataBuilder.buildMetaDataInternal(JSR109ClientMetaDataBuilder.java:213)
       at org.jboss.ws.metadata.JSR109ClientMetaDataBuilder.buildMetaData(JSR109ClientMetaDataBuilder.java:89)
       at org.jboss.ws.jaxrpc.ServiceImpl.<init>(ServiceImpl.java:89)
       at org.jboss.ws.jaxrpc.ServiceFactoryImpl.createService(ServiceFactoryImpl.java:157)
       at org.jboss.ws.jaxrpc.ServiceFactoryImpl.createService(ServiceFactoryImpl.java:128)
       at de.hska.ws.client.Main.main(Main.java:22)
      


        • 2. Re: Custom type: org.jboss.ws.WSException
          Juergen Zimmermann Master

          Uups, how do I generate jaxrpc-mappping.xml? Or do I have to edit it manually?

          • 4. Re: Custom type: org.jboss.ws.WSException
            Juergen Zimmermann Master

            Using the ANT task I can generate jaxrpc-mapping.xml. Although being on the CLASSPATH I still get this exception

            org.jboss.ws.WSException: Cannot obtain java type mapping for: {http://ws.hska.de/jaws}KundeWS at
            org.jboss.ws.metadata.JSR109MetaDataBuilder.buildParameterMetaDataRpc(JSR109MetaDataBuilder.java:314) at
            org.jboss.ws.metadata.JSR109MetaDataBuilder.setupOperationsFromWSDL(JSR109MetaDataBuilder.java:189) at
            org.jboss.ws.metadata.JSR109ClientMetaDataBuilder.buildMetaDataInternal(JSR109ClientMetaDataBuilder.java:213) at
            org.jboss.ws.metadata.JSR109ClientMetaDataBuilder.buildMetaData(JSR109ClientMetaDataBuilder.java:89) at
            org.jboss.ws.jaxrpc.ServiceImpl.<init>(ServiceImpl.java:89) at
            org.jboss.ws.jaxrpc.ServiceFactoryImpl.createService(ServiceFactoryImpl.java:157) at
            org.jboss.ws.jaxrpc.ServiceFactoryImpl.createService(ServiceFactoryImpl.java:128) at de.hska.test.WebServicesTest.setUp(Unknown Source)
            


            The generated jaxrpc-mapping.xml file:
            <?xml version='1.0' encoding='UTF-8'?><java-wsdl-mapping version='1.1' xmlns='http://java.sun.com/xml/ns/j2ee' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://java.sun.com/xml/ns/j2ee http://www.ibm.com/webservices/xsd/j2ee_jaxrpc_mapping_1_1.xsd'>
             <package-mapping>
             <package-type>de.hska.ws</package-type>
             <namespaceURI>http://ws.hska.de/jaws</namespaceURI>
             </package-mapping>
             <java-xml-type-mapping>
             <java-type>de.hska.ws.KundeWS</java-type>
             <root-type-qname xmlns:typeNS='http://ws.hska.de/jaws'>typeNS:KundeWS</root-type-qname>
             <qname-scope>complexType</qname-scope>
             <variable-mapping>
             <java-variable-name>art</java-variable-name>
             <xml-element-name>art</xml-element-name>
             </variable-mapping>
             <variable-mapping>
             <java-variable-name>id</java-variable-name>
             <xml-element-name>id</xml-element-name>
             </variable-mapping>
             <variable-mapping>
             <java-variable-name>nachname</java-variable-name>
             <xml-element-name>nachname</xml-element-name>
             </variable-mapping>
             <variable-mapping>
             <java-variable-name>rabatt</java-variable-name>
             <xml-element-name>rabatt</xml-element-name>
             </variable-mapping>
             <variable-mapping>
             <java-variable-name>vorname</java-variable-name>
             <xml-element-name>vorname</xml-element-name>
             </variable-mapping>
             </java-xml-type-mapping>
             <service-interface-mapping>
             <service-interface>de.hska.ws.KundenverwaltungWSService</service-interface>
             <wsdl-service-name xmlns:serviceNS='http://ws.hska.de/jaws'>serviceNS:KundenverwaltungWSService</wsdl-service-name>
             <port-mapping>
             <port-name>KundenverwaltungWSPort</port-name>
             <java-port-name>KundenverwaltungWSPort</java-port-name>
             </port-mapping>
             </service-interface-mapping>
             <service-endpoint-interface-mapping>
             <service-endpoint-interface>de.hska.ws.KundenverwaltungWS</service-endpoint-interface>
             <wsdl-port-type xmlns:portTypeNS='http://ws.hska.de/jaws'>portTypeNS:KundenverwaltungWS</wsdl-port-type>
             <wsdl-binding xmlns:bindingNS='http://ws.hska.de/jaws'>bindingNS:KundenverwaltungWSBinding</wsdl-binding>
             <service-endpoint-method-mapping>
             <java-method-name>findNachname</java-method-name>
             <wsdl-operation>findNachname</wsdl-operation>
             <method-param-parts-mapping>
             <param-position>0</param-position>
             <param-type>long</param-type>
             <wsdl-message-mapping>
             <wsdl-message xmlns:wsdlMsgNS='http://ws.hska.de/jaws'>wsdlMsgNS:KundenverwaltungWS_findNachname</wsdl-message>
             <wsdl-message-part-name>long_1</wsdl-message-part-name>
             <parameter-mode>IN</parameter-mode>
             </wsdl-message-mapping>
             </method-param-parts-mapping>
             <wsdl-return-value-mapping>
             <method-return-value>java.lang.String</method-return-value>
             <wsdl-message xmlns:wsdlMsgNS='http://ws.hska.de/jaws'>wsdlMsgNS:KundenverwaltungWS_findNachnameResponse</wsdl-message>
             <wsdl-message-part-name>result</wsdl-message-part-name>
             </wsdl-return-value-mapping>
             </service-endpoint-method-mapping>
             <service-endpoint-method-mapping>
             <java-method-name>deleteKunde</java-method-name>
             <wsdl-operation>deleteKunde</wsdl-operation>
             <method-param-parts-mapping>
             <param-position>0</param-position>
             <param-type>long</param-type>
             <wsdl-message-mapping>
             <wsdl-message xmlns:wsdlMsgNS='http://ws.hska.de/jaws'>wsdlMsgNS:KundenverwaltungWS_deleteKunde</wsdl-message>
             <wsdl-message-part-name>long_1</wsdl-message-part-name>
             <parameter-mode>IN</parameter-mode>
             </wsdl-message-mapping>
             </method-param-parts-mapping>
             </service-endpoint-method-mapping>
             <service-endpoint-method-mapping>
             <java-method-name>findKunde</java-method-name>
             <wsdl-operation>findKunde</wsdl-operation>
             <method-param-parts-mapping>
             <param-position>0</param-position>
             <param-type>long</param-type>
             <wsdl-message-mapping>
             <wsdl-message xmlns:wsdlMsgNS='http://ws.hska.de/jaws'>wsdlMsgNS:KundenverwaltungWS_findKunde</wsdl-message>
             <wsdl-message-part-name>long_1</wsdl-message-part-name>
             <parameter-mode>IN</parameter-mode>
             </wsdl-message-mapping>
             </method-param-parts-mapping>
             <wsdl-return-value-mapping>
             <method-return-value>de.hska.ws.KundeWS</method-return-value>
             <wsdl-message xmlns:wsdlMsgNS='http://ws.hska.de/jaws'>wsdlMsgNS:KundenverwaltungWS_findKundeResponse</wsdl-message>
             <wsdl-message-part-name>result</wsdl-message-part-name>
             </wsdl-return-value-mapping>
             </service-endpoint-method-mapping>
             </service-endpoint-interface-mapping>
            </java-wsdl-mapping>
            


            The WSDL obtained by http://localhost:8080/hskaEJB/KundenverwaltungWSBean?wsdl:
            <?xml version="1.0" encoding="UTF-8"?>
            <definitions name='KundenverwaltungWSService' targetNamespace='http://ws.hska.de/jaws' xmlns='http://schemas.xmlsoap.org/wsdl/' xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/' xmlns:tns='http://ws.hska.de/jaws' xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
             <types>
             <schema elementFormDefault='qualified' targetNamespace='http://ws.hska.de/jaws' xmlns='http://www.w3.org/2001/XMLSchema' xmlns:soap11-enc='http://schemas.xmlsoap.org/soap/encoding/' xmlns:tns='http://ws.hska.de/jaws' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
             <complexType name='KundeWS'>
             <sequence>
             <element name='art' nillable='true' type='string'/>
             <element name='id' type='long'/>
             <element name='nachname' nillable='true' type='string'/>
             <element name='rabatt' type='int'/>
             <element name='vorname' nillable='true' type='string'/>
             </sequence>
             </complexType>
             </schema>
             </types>
             <message name='KundenverwaltungWS_deleteKunde'>
             <part name='long_1' type='xsd:long'/>
             </message>
             <message name='KundenverwaltungWS_findKunde'>
             <part name='long_1' type='xsd:long'/>
             </message>
             <message name='KundenverwaltungWS_findKundeResponse'>
             <part name='result' type='tns:KundeWS'/>
             </message>
             <message name='KundenverwaltungWS_findNachname'>
             <part name='long_1' type='xsd:long'/>
             </message>
             <message name='KundenverwaltungWS_findNachnameResponse'>
             <part name='result' type='xsd:string'/>
             </message>
             <portType name='KundenverwaltungWS'>
             <operation name='deleteKunde' parameterOrder='long_1'>
             <input message='tns:KundenverwaltungWS_deleteKunde'/>
             </operation>
             <operation name='findKunde' parameterOrder='long_1'>
             <input message='tns:KundenverwaltungWS_findKunde'/>
             <output message='tns:KundenverwaltungWS_findKundeResponse'/>
             </operation>
             <operation name='findNachname' parameterOrder='long_1'>
             <input message='tns:KundenverwaltungWS_findNachname'/>
             <output message='tns:KundenverwaltungWS_findNachnameResponse'/>
             </operation>
             </portType>
             <binding name='KundenverwaltungWSBinding' type='tns:KundenverwaltungWS'>
             <soap:binding style='rpc' transport='http://schemas.xmlsoap.org/soap/http'/>
             <operation name='deleteKunde'>
             <soap:operation soapAction=''/>
             <input>
             <soap:body namespace='http://ws.hska.de/jaws' use='literal'/>
             </input>
             </operation>
             <operation name='findKunde'>
             <soap:operation soapAction=''/>
             <input>
             <soap:body namespace='http://ws.hska.de/jaws' use='literal'/>
             </input>
             <output>
             <soap:body namespace='http://ws.hska.de/jaws' use='literal'/>
             </output>
             </operation>
             <operation name='findNachname'>
             <soap:operation soapAction=''/>
             <input>
             <soap:body namespace='http://ws.hska.de/jaws' use='literal'/>
             </input>
             <output>
             <soap:body namespace='http://ws.hska.de/jaws' use='literal'/>
             </output>
             </operation>
             </binding>
             <service name='KundenverwaltungWSService'>
             <port binding='tns:KundenverwaltungWSBinding' name='KundenverwaltungWSPort'>
             <soap:address location='REPLACE_WITH_ACTUAL_URL'/>
             </port>
             </service>
            </definitions>
            


            • 5. Re: Custom type: org.jboss.ws.WSException
              Juergen Zimmermann Master

              jaxrpc-mapping.xml must be in a subdirectory META-INF

              • 6. Re: Custom type: org.jboss.ws.WSException
                Thomas Diesler Master

                If you turn on trace level debuging, you should be able to see at a very detailed level what is happening with your type.