JDK-8153060 : WebService annotation processor cannot use javac internal APIs
  • Type: Bug
  • Component: xml
  • Sub-Component: jax-ws
  • Affected Version: 9
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2016-03-30
  • Updated: 2017-03-07
  • Resolved: 2017-01-03
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 :  
Description
Running with -Dsun.reflect.debugModuleAccessChecks=true reveals this issue. Note that this is the standalone JAX-WS tools, it's not the version in the JDK (com.sun.tools.ws.processor.modeler.annotation.WebServiceAp is in com.sun.tools.internal.ws.processor.modeler.annotation.WebServiceAp in the JDK version)

[jwsc] java.lang.IllegalAccessException: class com.sun.tools.ws.processor.modeler.annotation.WebServiceAp cannot access class com.sun.tools.javac.processing.JavacProcessingEnvironment (in module jdk.compiler) because module jdk.compiler does not export com.sun.tools.javac.processing to unnamed module @544300a6
     [jwsc]     at sun.reflect.Reflection.throwIllegalAccessException(java.base@9-internal/Reflection.java:411)
     [jwsc]     at sun.reflect.Reflection.throwIllegalAccessException(java.base@9-internal/Reflection.java:402)
     [jwsc]     at sun.reflect.Reflection.ensureMemberAccess(java.base@9-internal/Reflection.java:99)
     [jwsc]     at java.lang.reflect.AccessibleObject.slowCheckMemberAccess(java.base@9-internal/AccessibleObject.java:355)
     [jwsc]     at java.lang.reflect.AccessibleObject.checkAccess(java.base@9-internal/AccessibleObject.java:347)
     [jwsc]     at java.lang.reflect.Method.invoke(java.base@9-internal/Method.java:525)
     [jwsc]     at com.sun.tools.ws.processor.modeler.annotation.WebServiceAp.parseArguments(WebServiceAp.java:174)
     [jwsc]     at com.sun.tools.ws.processor.modeler.annotation.WebServiceAp.init(WebServiceAp.java:157)
     [jwsc]     at com.sun.tools.javac.processing.JavacProcessingEnvironment$ProcessorState.<init>(jdk.compiler@9-internal/JavacProcessingEnvironment.java:671)
     [jwsc]     at com.sun.tools.javac.processing.JavacProcessingEnvironment$DiscoveredProcessors$ProcessorStateIterator.next(jdk.compiler@9-internal/JavacProcessingEnvironment.java:768)
     [jwsc]     at com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs(jdk.compiler@9-internal/JavacProcessingEnvironment.java:859)
     [jwsc]     at com.sun.tools.javac.processing.JavacProcessingEnvironment.access$2100(jdk.compiler@9-internal/JavacProcessingEnvironment.java:106)
     [jwsc]     at com.sun.tools.javac.processing.JavacProcessingEnvironment$Round.run(jdk.compiler@9-internal/JavacProcessingEnvironment.java:1181)
     [jwsc]     at com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(jdk.compiler@9-internal/JavacProcessingEnvironment.java:1289)
     [jwsc]     at com.sun.tools.javac.main.JavaCompiler.processAnnotations(jdk.compiler@9-internal/JavaCompiler.java:1229)
     [jwsc]     at com.sun.tools.javac.main.JavaCompiler.compile(jdk.compiler@9-internal/JavaCompiler.java:903)
     [jwsc]     at com.sun.tools.javac.main.Main.compile(jdk.compiler@9-internal/Main.java:261)
     [jwsc]     at com.sun.tools.javac.main.Main.compile(jdk.compiler@9-internal/Main.java:143)
     [jwsc]     at com.sun.tools.javac.Main.compile(jdk.compiler@9-internal/Main.java:73)
     [jwsc]     at com.sun.tools.ws.ant.Apt.execute(Apt.java:568)
     [jwsc]     :
Comments
A patch for this issue is currently being reviewed and tested.
17-07-2016

I've created JDK-8160069 to improve the exception thrown by XPathFactory::newInstance. As it stands, then the underlying cause is dropped and so information critical to diagnosing configuration issues are lost.
22-06-2016

I ran into a further problem. > [java] [java] Caused by: java.lang.RuntimeException: XPathFactory#newInstance() failed to create an XPathFactory for the default object model: http://java.sun.com/jaxp/xpath/dom with the XPathFactoryConfigurationException: javax.xml.xpath.XPathFactoryConfigurationException: java.util.ServiceConfigurationError: javax.xml.xpath.XPathFactory: Provider weblogic.xml.jaxp.RegistryXPathFactory could not be instantiated > [java] [java] at javax.xml.xpath.XPathFactory.newInstance(java.xml@9-ea/XPathFactory.java:102) > [java] [java] at com.sun.xml.ws.util.xml.XmlUtil.newXPathFactory(XmlUtil.java:420) > [java] [java] at com.sun.tools.ws.wsdl.parser.JAXWSBindingExtensionHandler$1.initialValue(JAXWSBindingExtensionHandler.java:75) > [java] [java] at com.sun.tools.ws.wsdl.parser.JAXWSBindingExtensionHandler$1.initialValue(JAXWSBindingExtensionHandler.java:72) > [java] [java] at com.sun.tools.ws.wsdl.parser.ContextClassloaderLocal.createNewInstance(ContextClassloaderLocal.java:76) > [java] [java] ... 29 more Caused by a missing properties file.
22-06-2016

com.sun.source.** is publicly exported com.sun.tools.** is internal API
08-05-2016

I have confirmed that compiling with the following fixes the problem, indicating that these need to be removed. -Djdk.launcher.addexports.29=jdk.compiler/com.sun.tools.doclint=ALL-UNNAMED -Djdk.launcher.addexports.30=jdk.compiler/com.sun.tools.doclint.resources=ALL-UNNAMED -Djdk.launcher.addexports.31=jdk.compiler/com.sun.tools.javac=ALL-UNNAMED -Djdk.launcher.addexports.32=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED -Djdk.launcher.addexports.33=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED -Djdk.launcher.addexports.34=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED -Djdk.launcher.addexports.35=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED -Djdk.launcher.addexports.36=jdk.compiler/com.sun.tools.javac.jvm=ALL-UNNAMED -Djdk.launcher.addexports.37=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED -Djdk.launcher.addexports.38=jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED -Djdk.launcher.addexports.39=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED -Djdk.launcher.addexports.40=jdk.compiler/com.sun.tools.javac.platform=ALL-UNNAMED -Djdk.launcher.addexports.41=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED -Djdk.launcher.addexports.42=jdk.compiler/com.sun.tools.javac.resources=ALL-UNNAMED -Djdk.launcher.addexports.43=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED -Djdk.launcher.addexports.44=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED
08-05-2016