2 Replies Latest reply on Apr 25, 2008 4:21 PM by Alexander Eitner

    Nullpointer at JBossXSEntityResolver.getXMLInputSource

    Alexander Eitner Newbie

      Hi, there already is a similar thread here: http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4124794#4124794 , but i think my situation is slightly different.

      Using JBoss 4.2.2 with integrated jbossws, i have a locally published WSDL file that i cannot manipulate.
      I have generated my client artifacts using Metro (wsimport tool), because i had to do some external binding customizations, which i dont know how to do with jbossws. I try to set up the service like this:

      RepositoryService repositoryService =
       new RepositoryService(new URL("http://localhost:8080/alfresco/wsdl/repository-service.wsdl"),
       new QName("repositoryService"));


      but i get this error:

      19:03:51,328 WARN [JBossWSEntityResolver] Trying to resolve id as a non-file URL: http://www.alfresco.org/ws/model/content/1.0
      19:03:52,703 ERROR [STDERR] java.lang.NullPointerException
      19:03:52,703 ERROR [STDERR] at org.jboss.ws.metadata.wsdl.xmlschema.JBossXSEntityResolver.getXMLInputSource(JBossXSEntityResolver.java:167)
      19:03:52,703 ERROR [STDERR] at org.jboss.ws.metadata.wsdl.xmlschema.JBossXSEntityResolver.resolveEntity(JBossXSEntityResolver.java:135)
      19:03:52,703 ERROR [STDERR] at org.apache.xerces.impl.XMLEntityManager.resolveEntity(Unknown Source)
      19:03:52,703 ERROR [STDERR] at org.apache.xerces.impl.xs.XMLSchemaLoader.resolveDocument(Unknown Source)
      19:03:52,703 ERROR [STDERR] at org.apache.xerces.impl.xs.traversers.XSDHandler.resolveSchema(Unknown Source)
      19:03:52,703 ERROR [STDERR] at org.apache.xerces.impl.xs.traversers.XSDHandler.constructTrees(Unknown Source)
      19:03:52,703 ERROR [STDERR] at org.apache.xerces.impl.xs.traversers.XSDHandler.constructTrees(Unknown Source)
      19:03:52,703 ERROR [STDERR] at org.apache.xerces.impl.xs.traversers.XSDHandler.parseSchema(Unknown Source)
      19:03:52,703 ERROR [STDERR] at org.apache.xerces.impl.xs.XMLSchemaLoader.loadSchema(Unknown Source)
      19:03:52,703 ERROR [STDERR] at org.apache.xerces.impl.xs.XMLSchemaLoader.loadGrammar(Unknown Source)
      19:03:52,703 ERROR [STDERR] at org.jboss.ws.tools.JavaToXSD.parseSchema(JavaToXSD.java:182)
      


      my wsd (excerptsl:

      <wsdl:definitions name="repository-service" targetNamespace="http://www.alfresco.org/ws/service/repository/1.0">
      <!-- ************************************** -->
      <!-- Copyright Alfresco Software, Inc. 2005 -->
      <!-- ************************************** -->
      â
       <wsdl:types>
      −
       <schema elementFormDefault="qualified" targetNamespace="http://www.alfresco.org/ws/service/repository/1.0">
      <xsd:import namespace="http://www.alfresco.org/ws/headers/1.0" schemaLocation="../wsdl/headers.xsd"/>
      <xsd:import namespace="http://www.alfresco.org/ws/cml/1.0" schemaLocation="../wsdl/cml.xsd"/>
      −
       <element name="createStore">
      −
       <complexType>
      −
       <sequence>
      <element name="scheme" type="xsd:string"/>
      <element name="address" type="xsd:string"/>
      </sequence>
      </complexType>
      </element>
      −
       <element name="createStoreResponse">
      −
       <complexType>
      −
       <sequence>
      <element name="createStoreReturn" type="cms:Store"/>
      </sequence>
      </complexType>
      </element>
      −
       <element name="getStores">
      −
       <complexType>
      <sequence/>
      </complexType>
      </element>
      −
       <element name="getStoresResponse">
      −
       <complexType>
      −
       <sequence>
      <element name="getStoresReturn" type="cms:Store" minOccurs="1" maxOccurs="unbounded"/>
      </sequence>
      </complexType>
      </element>
      −
       <element name="query">
      −
       <complexType>
      −
       <sequence>
      <element name="store" type="cms:Store"/>
      <element name="query" type="cms:Query"/>
      <element name="includeMetaData" type="xsd:boolean"/>
      </sequence>
      </complexType>
      </element>
      −....................
      </schema>
      </wsdl:types>
      −
       <wsdl:message name="Headers">
      <wsdl:documentation>Defines the SOAP headers used by this service.</wsdl:documentation>
      <wsdl:part element="rep:QueryConfiguration" name="QueryConfiguration"/>
      </wsdl:message>
      −
       <wsdl:message name="createStoreRequest">
      <wsdl:part element="rep:createStore" name="parameters"/>
      </wsdl:message>
      −
       <wsdl:message name="createStoreResponse">
      <wsdl:part element="rep:createStoreResponse" name="parameters"/>
      </wsdl:message>
      −
      ............−
       <wsdl:service name="RepositoryService">
      −
       <wsdl:documentation>
      Provides read and write operations against a repository.
      </wsdl:documentation>
      −
       <wsdl:port binding="rep:RepositoryServiceSoapBinding" name="RepositoryService">
      <wsdlsoap:address location="http://localhost:8080/alfresco/api/RepositoryService"/>
      </wsdl:port>
      </wsdl:service>
      </wsdl:definitions>
      


      Injection also doesnt work, as expected. And using an empty constructor also doesnt work. Any hints on this? Do i have to upgrade jbossws? Or any workaround to show the method where to search for my xsd?

      thx in advance


        • 1. Re: Nullpointer at JBossXSEntityResolver.getXMLInputSource
          Alexander Eitner Newbie

          Maybe this piece of information helps: I tried wsconsume and wsimport to generate the client artifacts, and both console outputs say:

           [wsimport] [WARNING] src-resolve.4.2: Error resolving component 'cms:Store'. It was detected that 'cms:Store' is in namespace 'http://www.alfresco.org/ws/model/content/1.0', but components from this namespace are not referenceable from schema document 'http://localhost:8080/alfresco/wsdl/repository-service.wsdl#types?schema1'. If this is the incorrect namespace, perhaps the prefix of 'cms:Store' needs to be changed. If this is the correct namespace, then an appropriate 'import' tag should be added to 'http://localhost:8080/alfresco/wsdl/repository-service.wsdl#types?schema1'.
           [wsimport] line 35 of http://localhost:8080/alfresco/wsdl/repository-service.wsdl#types?schema1
          


          I cannot modify the schema, cause its not mine. So i hope that its an incorrect namespace, which means that i would have to change the prefix of "cms:Store". Is "cms" the prefix? And how can i change it without changing the schema? Again external binding customization?

          Would be nice if anyone can confirm that i m on the right way....
          thx in advance



          • 2. Re: Nullpointer at JBossXSEntityResolver.getXMLInputSource
            Alexander Eitner Newbie

            Ok, think i can tell what the problem is now.

            In the wsdl, the schema is importet.

            <wsdl:types>
            −
             <schema elementFormDefault="qualified" targetNamespace="http://www.alfresco.org/ws/service/repository/1.0">
            <xsd:import namespace="http://www.alfresco.org/ws/headers/1.0" schemaLocation="../wsdl/headers.xsd"/>
            <xsd:import namespace="http://www.alfresco.org/ws/cml/1.0" schemaLocation="../wsdl/cml.xsd"/>
            −
             <element name="createStore">....
            


            Remember, the elements of namespace cms are missing. But inside one importet schema, there is another import:

            <xsd:schema targetNamespace="http://www.alfresco.org/ws/cml/1.0" elementFormDefault="qualified" version="0.1">
            −
             <xsd:annotation>
            −
             <xsd:documentation>
            
             Alfresco Web Services for Content Management. CML - Content Manipulation Language - Draft.
            
            </xsd:documentation>
            </xsd:annotation>
            <xsd:import namespace="http://www.alfresco.org/ws/model/content/1.0" schemaLocation="types.xsd"/>
            


            The last schema contains the cms:Store element, which cannot be resolved by wsimport/wsconsume. So is it right that you cannot refer to a schema embedded into another schema? What can i do here, preferable without changing the schema?