0 Replies Latest reply on Aug 31, 2005 12:36 PM by Harald Boehme

    TypeMapping problem with Java 1.4.2

    Harald Boehme Newbie

      Hi

      We observed a very different behaviour in resolving type mapping for QName under JBoss 4.0.2(default config) with Java 1.5 and 1.4. Under 1.5 it is working fine with 1.4 JBoss/Axis say no typemapping registered for javax.xml.namespaces.QName.

      We use a war file. Here the WSDL

      ?xml version="1.0" encoding="UTF-8"?>
      <definitions name="DeployService"
       targetNamespace="http://asg-platform.org/namespace/services/deployment"
       xmlns:tns="http://asg-platform.org/namespace/services/deployment"
       xmlns="http://schemas.xmlsoap.org/wsdl/"
       xmlns:xsd="http://www.w3.org/2001/XMLSchema"
       xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
      
       <!--============================================================
       T Y P E S
       =============================================================-->
      
       <types>
       <schema targetNamespace="http://asg-platform.org/namespace/services/deployment"
       xmlns:tns="http://asg-platform.org/namespace/services/deployment"
       xmlns:soap11-enc="http://schemas.xmlsoap.org/soap/encoding/"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
       xmlns:prop="http://asg-platform.org/namespaces/deployment"
       xmlns="http://www.w3.org/2001/XMLSchema"
       elementFormDefault="qualified">
      
       <xsd:import namespace="http://asg-platform.org/namespaces/deployment"
       schemaLocation="http://tb0.asg-platform.org/~saar/schemas/asg-deployment.xsd"/>
      
       <complexType name="deploy">
       <sequence>
       <element name="fileData" type="xsd:base64Binary" nillable="true"/>
       <element name="deployDesc" type="prop:servicePropertiesType" nillable="true"/>
       </sequence>
       </complexType>
      
       <complexType name="deployResponse">
       <sequence>
       <element name="svcID" type="xsd:string" nillable="true" minOccurs="0" maxOccurs="unbounded"/>
       </sequence>
       </complexType>
      
       <xsd:complexType name="DeploymentException">
       <xsd:sequence>
       <xsd:element name="message" type="xsd:string" nillable="true"/>
       <xsd:element name="fileName" type="xsd:string" nillable="true"/>
       </xsd:sequence>
       </xsd:complexType>
      
       <element name="deploy" type="tns:deploy"/>
       <element name="deployResponse" type="tns:deployResponse"/>
       <xsd:element name="DeploymentException" type="tns:DeploymentException"/>
       </schema>
       </types>
      
       <!--============================================================
       M E S S A G E S
       =============================================================-->
      
       <message name="DeployEndpoint_deploy">
       <part name="parameters" element="tns:deploy"/>
       </message>
      
       <message name="DeployEndpoint_deployResponse">
       <part name="result" element="tns:deployResponse"/>
       </message>
      
       <message name="DeployEndpoint_DeploymentException">
       <part name="DeploymentException" element="tns:DeploymentException"/>
       </message>
      
       <!--============================================================
       P O R T T Y P E
       =============================================================-->
      
       <portType name="DeployEndpoint">
       <operation name="deploy">
       <input message="tns:DeployEndpoint_deploy"/>
       <output message="tns:DeployEndpoint_deployResponse"/>
       <fault name ="DeploymentException" message="tns:DeployEndpoint_DeploymentException"/>
       </operation>
       </portType>
      
       <!--============================================================
       B I N D I N G
       =============================================================-->
      
       <binding name="DeployEndpointBinding" type="tns:DeployEndpoint">
       <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
       <operation name="deploy">
       <soap:operation soapAction=""/>
       <input>
       <soap:body use="literal"/>
       </input>
       <output>
       <soap:body use="literal"/>
       </output>
       <fault name="DeploymentException">
       <soap:fault name="DeploymentException" use="literal" />
       </fault>
       </operation>
       </binding>
      
       <!--============================================================
       S E R V I C E
       =============================================================-->
      
       <service name="DeployService">
       <port name="DeployEndpointPort" binding="tns:DeployEndpointBinding">
       <soap:address location="REPLACE_WITH_ACTUAL_URL"/>
       </port>
       </service>
      </definitions>
      


      The according XSD is
      <?xml version="1.0" encoding="UTF-8"?>
      <xsd:schema
       xmlns:prop="http://asg-platform.org/namespaces/deployment"
       xmlns:xsd="http://www.w3.org/2001/XMLSchema"
       targetNamespace="http://asg-platform.org/namespaces/deployment"
       elementFormDefault="qualified"
       attributeFormDefault="unqualified">
      
       <!-- serviceProperties -->
       <xsd:element name="serviceProperties" type="prop:servicePropertiesType">
       <xsd:annotation>
       <xsd:documentation>Defines the properties of ASG services.</xsd:documentation>
       </xsd:annotation>
       </xsd:element>
      
       <!-- servicePropertiesType -->
       <xsd:complexType name="servicePropertiesType">
       <xsd:sequence>
       <xsd:element name="service" type="prop:serviceType" maxOccurs="unbounded"/>
       </xsd:sequence>
       </xsd:complexType>
      
       <!-- serviceType -->
       <xsd:complexType name="serviceType">
       <xsd:annotation>
       <xsd:documentation>Defines an ASG service entry.</xsd:documentation>
       </xsd:annotation>
       <xsd:sequence>
       <xsd:element name="property" type="prop:propertyType" minOccurs="0" maxOccurs="unbounded"/>
       </xsd:sequence>
       <xsd:attribute name="serviceID" type="xsd:QName"/>
       <xsd:attribute name="implID" type="xsd:QName"/>
       </xsd:complexType>
      
       <!-- propertyType -->
       <xsd:complexType name="propertyType">
       <xsd:annotation>
       <xsd:documentation>
       Defines a property entry of an ASG service.
       </xsd:documentation>
       </xsd:annotation>
       <xsd:sequence>
       <xsd:element name="name" type="xsd:QName"/>
       <xsd:element name="valueType" type="prop:propertyValueType"/>
       <xsd:element name="defaultValue" type="xsd:string"/>
       <xsd:element name="type" type="prop:propertyTypeType"/>
       </xsd:sequence>
       </xsd:complexType>
      
       <!-- propertyValueType -->
       <xsd:simpleType name="propertyValueType">
       <xsd:annotation>
       <xsd:documentation>
       Data type restrictions for ASG service property entries
       according to ASG data type restrictions.
       </xsd:documentation>
       </xsd:annotation>
       <xsd:restriction base="xsd:QName">
       <xsd:enumeration value="xsd:string"/>
       <xsd:enumeration value="xsd:int"/>
       </xsd:restriction>
       </xsd:simpleType>
      
       <!-- propertyTypeType -->
       <xsd:simpleType name="propertyTypeType">
       <xsd:annotation>
       <xsd:documentation>
       Enumeration of property types.
       </xsd:documentation>
       </xsd:annotation>
       <xsd:restriction base="xsd:string">
       <xsd:enumeration value="service"/>
       <xsd:enumeration value="instance"/>
       </xsd:restriction>
       </xsd:simpleType>
      </xsd:schema>
      


      The typemapping is
      <?xml version="1.0" encoding="UTF-8"?>
      <java-wsdl-mapping xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.1" 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>org.asg.platform.deployment</package-type>
      <namespaceURI>http://asg-platform.org/namespace/services/deployment</namespaceURI>
      </package-mapping>
      <package-mapping>
      <package-type>org.asg.platform.deployment</package-type>
      <namespaceURI>http://asg-platform.org/namespaces/deployment</namespaceURI>
      </package-mapping>
      <java-xml-type-mapping>
      <java-type>org.asg.platform.deployment.PropertyType</java-type>
      <root-type-qname xmlns:typeNS="http://asg-platform.org/namespaces/deployment">typeNS:propertyType</root-type-qname>
      <qname-scope>complexType</qname-scope>
      <variable-mapping>
      <java-variable-name>name</java-variable-name>
      <xml-element-name>name</xml-element-name>
      </variable-mapping>
      <variable-mapping>
      <java-variable-name>valueType</java-variable-name>
      <xml-element-name>valueType</xml-element-name>
      </variable-mapping>
      <variable-mapping>
      <java-variable-name>defaultValue</java-variable-name>
      <xml-element-name>defaultValue</xml-element-name>
      </variable-mapping>
      <variable-mapping>
      <java-variable-name>type</java-variable-name>
      <xml-element-name>type</xml-element-name>
      </variable-mapping>
      </java-xml-type-mapping>
      <java-xml-type-mapping>
      <java-type>org.asg.platform.deployment.Deploy</java-type>
      <root-type-qname xmlns:typeNS="http://asg-platform.org/namespace/services/deployment">typeNS:deploy</root-type-qname>
      <qname-scope>complexType</qname-scope>
      <variable-mapping>
      <java-variable-name>fileData</java-variable-name>
      <xml-element-name>fileData</xml-element-name>
      </variable-mapping>
      <variable-mapping>
      <java-variable-name>deployDesc</java-variable-name>
      <xml-element-name>deployDesc</xml-element-name>
      </variable-mapping>
      </java-xml-type-mapping>
      <java-xml-type-mapping>
      <java-type>org.asg.platform.deployment.ServiceType</java-type>
      <root-type-qname xmlns:typeNS="http://asg-platform.org/namespaces/deployment">typeNS:serviceType</root-type-qname>
      <qname-scope>complexType</qname-scope>
      <variable-mapping>
      <java-variable-name>serviceID</java-variable-name>
      <xml-attribute-name>serviceID</xml-attribute-name>
      </variable-mapping>
      <variable-mapping>
      <java-variable-name>implID</java-variable-name>
      <xml-attribute-name>implID</xml-attribute-name>
      </variable-mapping>
      <variable-mapping>
      <java-variable-name>property</java-variable-name>
      <xml-element-name>property</xml-element-name>
      </variable-mapping>
      </java-xml-type-mapping>
      <java-xml-type-mapping>
      <java-type>org.asg.platform.deployment.DeployResponse</java-type>
      <root-type-qname xmlns:typeNS="http://asg-platform.org/namespace/services/deployment">typeNS:deployResponse</root-type-qname>
      <qname-scope>complexType</qname-scope>
      <variable-mapping>
      <java-variable-name>svcID</java-variable-name>
      <xml-element-name>svcID</xml-element-name>
      </variable-mapping>
      </java-xml-type-mapping>
      <java-xml-type-mapping>
      <java-type>org.asg.platform.deployment.DeploymentException</java-type>
      <root-type-qname xmlns:typeNS="http://asg-platform.org/namespace/services/deployment">typeNS:DeploymentException</root-type-qname>
      <qname-scope>complexType</qname-scope>
      <variable-mapping>
      <java-variable-name>message</java-variable-name>
      <xml-element-name>message</xml-element-name>
      </variable-mapping>
      <variable-mapping>
      <java-variable-name>fileName</java-variable-name>
      <xml-element-name>fileName</xml-element-name>
      </variable-mapping>
      </java-xml-type-mapping>
      <java-xml-type-mapping>
      <java-type>org.asg.platform.deployment.ServicePropertiesType</java-type>
      <root-type-qname xmlns:typeNS="http://asg-platform.org/namespaces/deployment">typeNS:servicePropertiesType</root-type-qname>
      <qname-scope>complexType</qname-scope>
      <variable-mapping>
      <java-variable-name>service</java-variable-name>
      <xml-element-name>service</xml-element-name>
      </variable-mapping>
      </java-xml-type-mapping>
      <java-xml-type-mapping>
      <java-type>org.asg.platform.deployment.PropertyType[]</java-type>
      <anonymous-type-qname>http://asg-platform.org/namespaces/deployment:serviceType>property[0,unbounded]</anonymous-type-qname>
      <qname-scope>complexType</qname-scope>
      </java-xml-type-mapping>
      <java-xml-type-mapping>
      <java-type>java.lang.String[]</java-type>
      <anonymous-type-qname>http://asg-platform.org/namespace/services/deployment:deployResponse>svcID[0,unbounded]</anonymous-type-qname>
      <qname-scope>complexType</qname-scope>
      </java-xml-type-mapping>
      <java-xml-type-mapping>
      <java-type>org.asg.platform.deployment.ServiceType[]</java-type>
      <anonymous-type-qname>http://asg-platform.org/namespaces/deployment:servicePropertiesType>service[1,unbounded]</anonymous-type-qname>
      <qname-scope>complexType</qname-scope>
      </java-xml-type-mapping>
      <java-xml-type-mapping>
      <java-type>org.asg.platform.deployment.PropertyValueType</java-type>
      <root-type-qname xmlns:typeNS="http://asg-platform.org/namespaces/deployment">typeNS:propertyValueType</root-type-qname>
      <qname-scope>simpleType</qname-scope>
      </java-xml-type-mapping>
      <java-xml-type-mapping>
      <java-type>org.asg.platform.deployment.PropertyTypeType</java-type>
      <root-type-qname xmlns:typeNS="http://asg-platform.org/namespaces/deployment">typeNS:propertyTypeType</root-type-qname>
      <qname-scope>simpleType</qname-scope>
      </java-xml-type-mapping>
      <exception-mapping>
      <exception-type>org.asg.platform.deployment.DeploymentException</exception-type>
      <wsdl-message xmlns:exMsgNS="http://asg-platform.org/namespace/services/deployment">exMsgNS:DeployEndpoint_DeploymentException</wsdl-message>
      <constructor-parameter-order>
      <element-name>message</element-name>
      <element-name>fileName</element-name>
      </constructor-parameter-order>
      </exception-mapping>
      <service-interface-mapping>
      <service-interface>org.asg.platform.deployment.DeployService</service-interface>
      <wsdl-service-name xmlns:serviceNS="http://asg-platform.org/namespace/services/deployment">serviceNS:DeployService</wsdl-service-name>
      <port-mapping>
      <port-name>DeployEndpointPort</port-name>
      <java-port-name>DeployEndpointPort</java-port-name>
      </port-mapping>
      </service-interface-mapping>
      <service-endpoint-interface-mapping>
      <service-endpoint-interface>org.asg.platform.deployment.DeployEndpoint</service-endpoint-interface>
      <wsdl-port-type xmlns:portTypeNS="http://asg-platform.org/namespace/services/deployment">portTypeNS:DeployEndpoint</wsdl-port-type>
      <wsdl-binding xmlns:bindingNS="http://asg-platform.org/namespace/services/deployment">bindingNS:DeployEndpointBinding</wsdl-binding>
      <service-endpoint-method-mapping>
      <java-method-name>deploy</java-method-name>
      <wsdl-operation>deploy</wsdl-operation>
      <method-param-parts-mapping>
      <param-position>0</param-position>
      <param-type>org.asg.platform.deployment.Deploy</param-type>
      <wsdl-message-mapping>
      <wsdl-message xmlns:wsdlMsgNS="http://asg-platform.org/namespace/services/deployment">wsdlMsgNS:DeployEndpoint_deploy</wsdl-message>
      <wsdl-message-part-name>parameters</wsdl-message-part-name>
      <parameter-mode>IN</parameter-mode>
      </wsdl-message-mapping>
      </method-param-parts-mapping>
      <wsdl-return-value-mapping>
      <method-return-value>org.asg.platform.deployment.DeployResponse</method-return-value>
      <wsdl-message xmlns:wsdlMsgNS="http://asg-platform.org/namespace/services/deployment">wsdlMsgNS:DeployEndpoint_deployResponse</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 same war file is working if JBoss 4.0.2 run with Java 1.5 and throws
      2005-08-31 12:21:35,951 ERROR [org.jboss.axis.providers.java.RPCInvocation] org.
      xml.sax.SAXException: Unregistered type: class javax.xml.namespace.QName
      org.xml.sax.SAXException: Unregistered type: class javax.xml.namespace.QName
       at org.jboss.axis.encoding.ser.BeanDeserializer.onStartElement(BeanDeser
      ializer.java:260)
       at org.jboss.axis.encoding.DeserializerImpl.startElement(DeserializerImp
      l.java:466)
       at org.jboss.axis.encoding.DeserializationContextImpl.startElement(Deser
      ializationContextImpl.java:1182)
       at org.jboss.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.jav
      a:244)
       at org.jboss.axis.message.SOAPElementAxisImpl.publishToHandler(SOAPEleme
      ntAxisImpl.java:1386)
       at org.jboss.axis.message.RPCElement.deserialize(RPCElement.java:262)