JDK-8175980 : Can't locate the imported schema when generating the client source if wsdlLocation is specified in WebServiceProvider anotation
  • Type: Bug
  • Component: xml
  • Sub-Component: jax-ws
  • Affected Version: 9
  • Priority: P2
  • Status: Closed
  • Resolution: Duplicate
  • Submitted: 2017-02-28
  • Updated: 2017-06-19
  • Resolved: 2017-06-19
Related Reports
Duplicate :  
Relates :  
Description
This issue is introduced in 9b158, I suspect it's caused by JDK-8174735.

WSDL file includes a type, imported from a xsd file. WebServiceProvider class is defined like following:
@WebServiceProvider(
    wsdlLocation="WEB-INF/wsdl/hello_literal.wsdl",
...

Start the web service and generate client from the deployed wsdl, get the following error message:
Endpoint Address=http://localhost:46526/server.http_head_677.server/Hello
parsing WSDL...

[ERROR] IOException thrown when processing "http://localhost:46526/server.http_head_677.server/hello.xsd". Exception: java.io.FileNotFoundException: http://localhost:46526/server.http_head_677.server/hello.xsd.

[WARNING] schema_reference.4: Failed to read schema document 'hello.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not <xsd:schema>.
  line 5 of http://localhost:46526/server.http_head_677.server/Hello?wsdl#types?schema1

Exception in thread "main" com.sun.tools.internal.ws.wscompile.AbortException
	at jdk.xml.ws@9-internal/com.sun.tools.internal.ws.processor.modeler.wsdl.JAXBModelBuilder.bind(JAXBModelBuilder.java:129)
	at jdk.xml.ws@9-internal/com.sun.tools.internal.ws.processor.modeler.wsdl.WSDLModeler.buildJAXBModel(WSDLModeler.java:2283)
	at jdk.xml.ws@9-internal/com.sun.tools.internal.ws.processor.modeler.wsdl.WSDLModeler.internalBuildModel(WSDLModeler.java:183)
	at jdk.xml.ws@9-internal/com.sun.tools.internal.ws.processor.modeler.wsdl.WSDLModeler.buildModel(WSDLModeler.java:126)
	at jdk.xml.ws@9-internal/com.sun.tools.internal.ws.wscompile.WsimportTool.buildWsdlModel(WsimportTool.java:429)
	at jdk.xml.ws@9-internal/com.sun.tools.internal.ws.wscompile.WsimportTool.run(WsimportTool.java:190)
	at jdk.xml.ws@9-internal/com.sun.tools.internal.ws.wscompile.WsimportTool.run(WsimportTool.java:168)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:547)
	at jdk.xml.ws@9-internal/com.sun.tools.internal.ws.Invoker.invoke(Invoker.java:138)
	at jdk.xml.ws@9-internal/com.sun.tools.internal.ws.WsImport.main(WsImport.java:41)


Remove wsdlLocation from @WebServiceProvider, the problem will disappear.
Comments
Fixed by JAXWS-RI sync changeset: JDK-8176508
19-06-2017