eclipse-ee4j / jaxb-ri

Jaxb RI
https://eclipse-ee4j.github.io/jaxb-ri/
BSD 3-Clause "New" or "Revised" License
206 stars 114 forks source link

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

Open Tomas-Kraus opened 12 years ago

Tomas-Kraus commented 12 years ago

-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)

Affected Versions

[2.2.5]

Tomas-Kraus commented 6 years ago
Tomas-Kraus commented 12 years ago

@glassfishrobot Commented Reported by @lukasj

Tomas-Kraus commented 12 years ago

@glassfishrobot Commented @lukasj said: quick and dirty fix handling only http and https protocols

Tomas-Kraus commented 11 years ago

@glassfishrobot Commented snajper said: Why are we waiving this one?

Tomas-Kraus commented 12 years ago

@glassfishrobot Commented File: jaxb-876.diff.txt Attached By: @lukasj

Tomas-Kraus commented 12 years ago

@glassfishrobot Commented File: wsdl-lib-1.0-SNAPSHOT.jar Attached By: @lukasj

Tomas-Kraus commented 12 years ago

@glassfishrobot Commented Issue-Links: is related to JAX_WS_COMMONS-4 JAX_WS_COMMONS-80

Tomas-Kraus commented 12 years ago

@glassfishrobot Commented Was assigned to yaroska

Tomas-Kraus commented 7 years ago

@glassfishrobot Commented This issue was imported from java.net JIRA JAXB-876