JDK-8159240 : XSOM parser incorrectly processes type names with whitespaces
  • Type: Bug
  • Component: xml
  • Sub-Component: jaxb
  • Affected Version: 6u101
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2016-06-10
  • Updated: 2018-03-21
  • Resolved: 2017-10-02
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 6 JDK 7 JDK 8 Other
6u181Fixed 7u171Fixed 8u161Fixed openjdk7uFixed
Related Reports
Relates :  
Description
The XMLSchema defines that whitespaces should be collapsed for type names and different attribute values that can contain type names. JAXB internal schema parser (XSOM) does not support this functionality. And it can cause failures in wsimport tool. WSDL file with such types definition section (space in 'type' attribute value):
  <wsdl:types>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
      targetNamespace="http://www.temp.com/Service/">
      <xsd:element name="HelloRequest" type="xsd:string"/>
      <xsd:element name="HelloResponse" type="xsd:string"/>
          <xsd:complexType name="info">
                  <xsd:sequence>
                        <xsd:element name="firstname" type="xsd:string"/>
                        <xsd:element name="lastname" type="xsd:string"/>
                  </xsd:sequence>
          </xsd:complexType>
                  
          <xsd:complexType name="usage">
                  <xsd:all>
                        <xsd:element name="customerCharacteristics" type="hy:info "/>
                  </xsd:all>
          </xsd:complexType>
    </xsd:schema>
  </wsdl:types>

Causing the following wsimport failure:
parsing WSDL...


[ERROR] undefined simple or complex type 'hy:info '
  line 25 of file:/home/aefimov/Oracle/BUGS/JAX-WS_B/23559210_wsimport_spaces/sampleservice.wsdl.xml

Exception in thread "main" com.sun.tools.internal.ws.wscompile.AbortException
	at com.sun.tools.internal.ws.processor.modeler.wsdl.JAXBModelBuilder.bind(JAXBModelBuilder.java:129)
	at com.sun.tools.internal.ws.processor.modeler.wsdl.WSDLModeler.buildJAXBModel(WSDLModeler.java:2283)
	at com.sun.tools.internal.ws.processor.modeler.wsdl.WSDLModeler.internalBuildModel(WSDLModeler.java:183)
	at com.sun.tools.internal.ws.processor.modeler.wsdl.WSDLModeler.buildModel(WSDLModeler.java:126)
	at com.sun.tools.internal.ws.wscompile.WsimportTool.buildWsdlModel(WsimportTool.java:429)
	at com.sun.tools.internal.ws.wscompile.WsimportTool.run(WsimportTool.java:190)
	at com.sun.tools.internal.ws.wscompile.WsimportTool.run(WsimportTool.java:168)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at com.sun.tools.internal.ws.Invoker.invoke(Invoker.java:159)
	at com.sun.tools.internal.ws.WsImport.main(WsImport.java:42)

XSOM parser should be modified to collapse whitespaces in type names in respect to XMLSchema types definitions (https://www.w3.org/2001/XMLSchema.xsd)
Comments
JDK8 review/approval mail thread: http://mail.openjdk.java.net/pipermail/core-libs-dev/2017-September/049334.html
29-09-2017

Reopening this bug to track JDK8 backport. The JDK9 fix was delivered through JAXWS-RI sync: JDK-8164479.
29-09-2017

This bug was fixed by bringing latest JAXWS-RI changes into JDK9, see JDK-8164479
26-12-2016

Yes, I know. Trim will be just moved to another place with fixing this one.
17-10-2016