jaxb
  1. jaxb
  2. JAXB-876

absolute URLs from within wsdl/xsd packaged in a jar are not being resolved

    Details

    • Type: Bug Bug
    • Status: In Progress
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 2.2.5
    • Fix Version/s: None
    • Component/s: runtime
    • Labels:
      None

      Description

      -have a jar containing wsdl, schema and xml catalog, ie the one attached, and let the wsdl refer to the schema using common URL (ie using http or https protocol - generally arbitrary protocol can be used)

      -now run wsimport for the wsdl in the jar:

      lukas@lucas-ubuntu:/tmp/jxb-issue$ /space/sources/jws/jaxws22/jaxws-ri/dist/jaxws-ri/bin/wsimport.sh -keep -s . -verbose -Xnocompile jar:file:wsdl-lib-1.0-SNAPSHOT.jar\!/ProcessOrder.wsdl
      

      => stacktrace similar to the following one appears:

      com.sun.istack.internal.SAXParseException2; IOException thrown when processing "jar:file:wsdl-lib-1.0-SNAPSHOT.jar!http://localhost:8080/WebApplication1/ProcessOrder?xsd=1". Exception: java.net.MalformedURLException: no !/ in spec.
      	at com.sun.tools.internal.xjc.ErrorReceiver.error(ErrorReceiver.java:79)
      	at com.sun.tools.internal.xjc.reader.internalizer.DOMForest.parse(DOMForest.java:391)
      	at com.sun.tools.internal.xjc.reader.internalizer.DOMForest.parse(DOMForest.java:290)
      	at com.sun.tools.internal.xjc.reader.internalizer.AbstractReferenceFinderImpl.startElement(AbstractReferenceFinderImpl.java:100)
      	at org.xml.sax.helpers.XMLFilterImpl.startElement(XMLFilterImpl.java:551)
      	at org.xml.sax.helpers.XMLFilterImpl.startElement(XMLFilterImpl.java:551)
      	at com.sun.tools.internal.ws.wsdl.parser.DOMForestScanner$LocationResolver.startElement(DOMForestScanner.java:128)
      	at com.sun.xml.internal.bind.unmarshaller.DOMScanner.visit(DOMScanner.java:229)
      	at com.sun.xml.internal.bind.unmarshaller.DOMScanner.visit(DOMScanner.java:266)
      	at com.sun.xml.internal.bind.unmarshaller.DOMScanner.visit(DOMScanner.java:235)
      	at com.sun.xml.internal.bind.unmarshaller.DOMScanner.scan(DOMScanner.java:112)
      	at com.sun.tools.internal.ws.wsdl.parser.DOMForestScanner.scan(DOMForestScanner.java:76)
      	at com.sun.tools.internal.ws.processor.modeler.wsdl.JAXBModelBuilder.internalBuildJAXBModel(JAXBModelBuilder.java:94)
      	at com.sun.tools.internal.ws.processor.modeler.wsdl.JAXBModelBuilder.<init>(JAXBModelBuilder.java:66)
      	at com.sun.tools.internal.ws.processor.modeler.wsdl.WSDLModeler.buildJAXBModel(WSDLModeler.java:2213)
      	at com.sun.tools.internal.ws.processor.modeler.wsdl.WSDLModeler.internalBuildModel(WSDLModeler.java:175)
      	at com.sun.tools.internal.ws.processor.modeler.wsdl.WSDLModeler.buildModel(WSDLModeler.java:121)
      	at com.sun.tools.internal.ws.wscompile.WsimportTool.run(WsimportTool.java:178)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:601)
      	at com.sun.tools.internal.ws.Invoker.invoke(Invoker.java:120)
      	at com.sun.tools.internal.ws.WsImport.main(WsImport.java:42)
      Caused by: java.net.MalformedURLException: no !/ in spec
      	at java.net.URL.<init>(URL.java:617)
      	at java.net.URL.<init>(URL.java:480)
      	at java.net.URL.<init>(URL.java:429)
      	at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity(XMLEntityManager.java:626)
      	at com.sun.org.apache.xerces.internal.impl.XMLVersionDetector.determineDocVersion(XMLVersionDetector.java:189)
      	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:799)
      	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764)
      	at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:123)
      	at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1210)
      	at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:568)
      	at com.sun.tools.internal.xjc.reader.internalizer.DOMForest.parse(DOMForest.java:383)
      	... 22 more
      Caused by: java.lang.NullPointerException: no !/ in spec
      	at sun.net.www.protocol.jar.Handler.parseAbsoluteSpec(Handler.java:170)
      	at sun.net.www.protocol.jar.Handler.parseURL(Handler.java:150)
      	at java.net.URL.<init>(URL.java:612)
      	... 32 more
      [ERROR] IOException thrown when processing "jar:file:wsdl-lib-1.0-SNAPSHOT.jar!http://localhost:8080/WebApplication1/ProcessOrder?xsd=1". Exception: java.net.MalformedURLException: no !/ in spec.
      

      Problem is that JAXB is looking for 'jar:file:...!http://' URL but it should be looking for 'http://localhost:8080/WebApplication1/ProcessOrder?xsd=1' instead and it should be also able to resolve this URL using user defined catalog (if any)

        Issue Links

          Activity

          Hide
          Lukas Jungmann added a comment -

          quick and dirty fix handling only http and https protocols

          Show
          Lukas Jungmann added a comment - quick and dirty fix handling only http and https protocols
          Hide
          Martin Grebac added a comment -

          Why are we waiving this one?

          Show
          Martin Grebac added a comment - Why are we waiving this one?

            People

            • Assignee:
              Iaroslav Savytskyi
              Reporter:
              Lukas Jungmann
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: