Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-3891

WSDL2JS Null Pointer Exception

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.4.3
    • 2.4.5, 2.5.1
    • JavaScript Client
    • None
    • Windows Vista 64-bit

    • Unknown

    Description

      Given my wsdl and xsd wsdl2java.bat runs without issue but wsdl2js.bat throws Null Pointer Exception:

      org.apache.cxf.tools.common.ToolException: java.lang.NullPointerException
              at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:294)
              at org.apache.cxf.tools.wsdlto.javascript.JavaScriptContainer.execute(JavaScriptContainer.java:154)
              at org.apache.cxf.tools.common.toolspec.ToolRunner.runTool(ToolRunner.java:103)
              at org.apache.cxf.tools.common.toolspec.ToolRunner.runTool(ToolRunner.java:67)
              at org.apache.cxf.tools.wsdlto.javascript.WSDLToJavaScript.run(WSDLToJavaScript.java:60)
              at org.apache.cxf.tools.wsdlto.javascript.WSDLToJavaScript.main(WSDLToJavaScript.java:97)
      Caused by: java.lang.NullPointerException
              at org.apache.ws.commons.schema.XmlSchemaCollection.getTypeByQName(XmlSchemaCollection.java:221)
              at org.apache.cxf.common.xmlschema.SchemaCollection.getTypeByQName(SchemaCollection.java:106)
              at org.apache.cxf.javascript.service.ServiceJavascriptBuilder.getElementsForParts(ServiceJavascriptBuilder.java:745)
              at org.apache.cxf.javascript.service.ServiceJavascriptBuilder.createResponseDeserializer(ServiceJavascriptBuilder.java:516)
              at org.apache.cxf.javascript.service.ServiceJavascriptBuilder.end(ServiceJavascriptBuilder.java:269)
              at org.apache.cxf.service.ServiceModelVisitor.walk(ServiceModelVisitor.java:76)
              at org.apache.cxf.tools.wsdlto.javascript.WSDLToJavaScriptProcessor.process(WSDLToJavaScriptProcessor.java:93)
              at org.apache.cxf.tools.wsdlto.javascript.JavaScriptContainer.execute(JavaScriptContainer.java:147)
              at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:286)
              ... 5 more
      

      xsd:

      <?xml version="1.0" encoding="UTF-8"?>
      <schema
      	xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://webservices/"
      	xmlns:tns="http://webservices/" elementFormDefault="qualified">
      	
      	<!-- getFacilities -->
      	<element name="FacilityID" type="string" />
      	<element name="FacilityName" type="string" />
      	<element name="Facility">
      		<complexType>
      			<sequence>
      				<element ref="tns:FacilityID" />
      				<element ref="tns:FacilityName" />
      			</sequence>
      		</complexType>
      	</element>
      	<element name="Facilities">
      		<complexType>
      			<sequence>
      				<element maxOccurs="unbounded" ref="tns:Facility" />
      			</sequence>
      		</complexType>
      	</element>
      	
      	<!-- getAreasForFacility -->
      	<element name="AreaName" type="string" />
      	<element name="Area">
      		<complexType>
      			<sequence>
      				<element ref="tns:FacilityID" />
      				<element ref="tns:AreaName" />
      			</sequence>
      		</complexType>
      	</element>
      	<element name="Areas">
      		<complexType>
      			<sequence>
      				<element maxOccurs="unbounded" ref="tns:Area" />
      			</sequence>
      		</complexType>
      	</element>
      	
      	<!-- getLocationsForArea -->
      	<element name="GetLocationsRequestParam">
      		<complexType>
      			<sequence>
      				<element ref="tns:FacilityID" />
      				<element ref="tns:AreaName" />
      			</sequence>
      		</complexType>
      	</element>
      	<element name="LocationName" type="string" />
      	<element name="LocationState" type="string" />
      	<element name="Location">
      		<complexType>
      			<sequence>
      				<element ref="tns:FacilityID" />
      				<element ref="tns:AreaName" />
      				<element ref="tns:LocationName" />
      				<element ref="tns:LocationState" />
      			</sequence>
      		</complexType>
      	</element>
      	<element name="Locations">
      		<complexType>
      			<sequence>
      				<element maxOccurs="unbounded" ref="tns:Location" />
      			</sequence>
      		</complexType>
      	</element>
      	
      	<!-- getLocationState -->
      	<element name="GetLocationStateRequestParam">
      		<complexType>
      			<sequence>
      				<element ref="tns:FacilityID" />
      				<element ref="tns:AreaName" />
      				<element ref="tns:LocationName" />
      			</sequence>
      		</complexType>
      	</element>
      	
      </schema>
      

      wsdl:

      <?xml version="1.0" encoding="UTF-8" standalone="no"?>
      <wsdl:definitions
      	xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://webservices/"
      	xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
      	name="OnTrack" targetNamespace="http://webservices/">
      
      	<wsdl:types>
      		<xsd:schema>
      			<xsd:import schemaLocation="OnTrack.xsd" namespace="http://webservices/" />
      		</xsd:schema>
      	</wsdl:types>
        
      	<wsdl:message name="GetFacilitiesRequest" />
      	<wsdl:message name="GetFacilitiesResponse">
      		<wsdl:part element="tns:Facilities" name="Facilities" />
      	</wsdl:message>
      	<wsdl:message name="GetAreasRequest">
      		<wsdl:part element="tns:FacilityID" name="FacilityID" />
      	</wsdl:message>
      	<wsdl:message name="GetAreasResponse">
      		<wsdl:part element="tns:Areas" name="Areas" />
      	</wsdl:message>
      	<wsdl:message name="GetLocationsRequest">
      		<wsdl:part element="tns:GetLocationsRequestParam" name="FacilityID_AreaName" />
      	</wsdl:message>
      	<wsdl:message name="GetLocationsResponse">
      		<wsdl:part element="tns:Locations" name="Locations" />
      	</wsdl:message>
      	<wsdl:message name="GetLocationStateRequest">
      		<wsdl:part element="tns:GetLocationStateRequestParam" name="FacilityID_AreaName_LocationName" />
      	</wsdl:message>
      	<wsdl:message name="GetLocationStateResponse">
      		<wsdl:part element="tns:Location" name="Location" />
      	</wsdl:message>
        
      	<wsdl:portType name="OnTrack">
      		<wsdl:operation name="GetFacilities">
      			<wsdl:input message="tns:GetFacilitiesRequest"/>
      			<wsdl:output message="tns:GetFacilitiesResponse"/>
      		</wsdl:operation>
      		<wsdl:operation name="GetAreas">
      			<wsdl:input message="tns:GetAreasRequest" />
      			<wsdl:output message="tns:GetAreasResponse" />
      		</wsdl:operation>
      		<wsdl:operation name="GetLocations">
      			<wsdl:input message="tns:GetLocationsRequest" />
      			<wsdl:output message="tns:GetLocationsResponse" />
      		</wsdl:operation>
      		<wsdl:operation name="GetLocationState">
      			<wsdl:input message="tns:GetLocationStateRequest" />
      			<wsdl:output message="tns:GetLocationStateResponse" />
      		</wsdl:operation>
      	</wsdl:portType>
        
      	<wsdl:binding name="OnTrackSOAP" type="tns:OnTrack">
      		<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
      		<wsdl:operation name="GetFacilities">
      			<soap:operation soapAction=""/>
      			<wsdl:input>
      				<soap:body use="literal"/>
      			</wsdl:input>
      			<wsdl:output>
      				<soap:body use="literal"/>
      			</wsdl:output>
      		</wsdl:operation>
      		<wsdl:operation name="GetAreas">
      			<soap:operation soapAction=""/>
      			<wsdl:input>
      				<soap:body use="literal"/>
      			</wsdl:input>
      			<wsdl:output>
      				<soap:body use="literal"/>
      			</wsdl:output>
      		</wsdl:operation>
      		<wsdl:operation name="GetLocations">
      			<soap:operation soapAction=""/>
      			<wsdl:input>
      				<soap:body use="literal"/>
      			</wsdl:input>
      			<wsdl:output>
      				<soap:body use="literal"/>
      			</wsdl:output>
      		</wsdl:operation>
      		<wsdl:operation name="GetLocationState">
      			<soap:operation soapAction=""/>
      			<wsdl:input>
      				<soap:body use="literal"/>
      			</wsdl:input>
      			<wsdl:output>
      				<soap:body use="literal"/>
      			</wsdl:output>
      		</wsdl:operation>
      	</wsdl:binding>
        
      	<wsdl:service name="OnTrack">
      		<wsdl:port binding="tns:OnTrackSOAP" name="OnTrackSOAP">
      			<soap:address location="http://godleski2-dt/OnTrack"/>
      		</wsdl:port>
      	</wsdl:service>
        
      </wsdl:definitions>
      

      Attachments

        Activity

          People

            dkulp Daniel Kulp
            ixeldog Joe Godleski
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: