JDK-8166745 : Eliminate SAAJ dependency on JAXP internal API
  • Type: Bug
  • Component: xml
  • Sub-Component: jax-ws
  • Affected Version: 9
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2016-09-26
  • Updated: 2017-02-13
  • Resolved: 2017-02-13
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 9
9Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Description
java.xml currently exports a few qualified exports to java.xml.ws to use its internal API.   java.xml.ws may be run as standalone that will not be able to access these internal APis unless --add-exports option is used to break in encapsulation.

This issue suggests to re-examine SAAJ use of JAXP internal APIs and determine if it's possible to eliminate its dependency of JAXP internals.
 
 com.sun.xml.internal.messaging.saaj.soap.SOAPDocumentFragment -> com.sun.org.apache.xerces.internal.dom.CoreDocumentImpl java.xml (qualified)
   com.sun.xml.internal.messaging.saaj.soap.SOAPDocumentFragment -> com.sun.org.apache.xerces.internal.dom.DocumentFragmentImpl java.xml (qualified)
   com.sun.xml.internal.messaging.saaj.soap.SOAPDocumentImpl -> com.sun.org.apache.xerces.internal.dom.CoreDocumentImpl java.xml (qualified)
   com.sun.xml.internal.messaging.saaj.soap.SOAPDocumentImpl -> com.sun.org.apache.xerces.internal.dom.DocumentImpl java.xml (qualified)
   com.sun.xml.internal.messaging.saaj.soap.impl.CDATAImpl -> com.sun.org.apache.xerces.internal.dom.CDATASectionImpl java.xml (qualified)
   com.sun.xml.internal.messaging.saaj.soap.impl.CDATAImpl -> com.sun.org.apache.xerces.internal.dom.CoreDocumentImpl java.xml (qualified)
   com.sun.xml.internal.messaging.saaj.soap.impl.ElementImpl -> com.sun.org.apache.xerces.internal.dom.CoreDocumentImpl java.xml (qualified)
   com.sun.xml.internal.messaging.saaj.soap.impl.ElementImpl -> com.sun.org.apache.xerces.internal.dom.ElementNSImpl java.xml (qualified)
   com.sun.xml.internal.messaging.saaj.soap.impl.SOAPCommentImpl -> com.sun.org.apache.xerces.internal.dom.CommentImpl java.xml (qualified)
   com.sun.xml.internal.messaging.saaj.soap.impl.SOAPCommentImpl -> com.sun.org.apache.xerces.internal.dom.CoreDocumentImpl java.xml (qualified)
   com.sun.xml.internal.messaging.saaj.soap.impl.SOAPTextImpl -> com.sun.org.apache.xerces.internal.dom.CoreDocumentImpl java.xml (qualified)
   com.sun.xml.internal.messaging.saaj.soap.impl.SOAPTextImpl -> com.sun.org.apache.xerces.internal.dom.TextImpl    java.xml (qualified)
   com.sun.xml.internal.messaging.saaj.util.ParserPool -> com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl java.xml (qualified)
   com.sun.xml.internal.messaging.saaj.util.ParserPool -> com.sun.org.apache.xerces.internal.util.SymbolTable java.xml (qualified)

Comments
With JDK-8164479 resolved, the remaining qualified exports are: exports com.sun.xml.internal.stream.writers to java.xml.ws exports com.sun.org.apache.xerces.internal.dom to java.xml.ws exports com.sun.org.apache.xerces.internal.util to java.xml.ws exports com.sun.org.apache.xerces.internal.jaxp to java.xml.ws
21-11-2016

I have checked saaj-ri code and all saaj classes from bug description (with exception for ParserPool) are extending JDK xerces classes from internal package. For example: public class ElementImpl extends com.sun.org.apache.xerces.internal.dom.ElementNSImpl Furthermore saaj api interfaces are extending dom interfaces: public interface SOAPElement extends Node, Element If we for example remove extension from ElementImpl, which implements SOAPElement we would have to have com.sun.org.apache.xerces.internal.dom.ElementNsImpl instance inside and decorate all methods. The problem is, saaj-ri doesn't use DocumentBuilder and Document to create document and its elements with provided factory methods, it uses its own factories for this which are creating new instances of extended elements in turn. So to eliminate dependency we would have to use Xerces factory methods to create and delegate all calls to internal.dom.* objects than. I am not sure it would be proper and will not break saaj-ri clients compatibility.
27-09-2016