JDK-8214161 : java.lang.IllegalAccessError: class jdk.internal.event.X509CertificateEvent (in module java.base) cannot access class jdk.jfr.internal.handlers.EventHandler (in module jdk.jfr) because module java.base does not read module jdk.jfr
  • Type: Bug
  • Component: hotspot
  • Sub-Component: jfr
  • Affected Version: 12
  • Priority: P1
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2018-11-21
  • Updated: 2019-06-13
  • Resolved: 2018-11-23
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 11 JDK 12
11.0.5-oracleFixed 12 b22Fixed
Related Reports
Duplicate :  
Relates :  
Relates :  
Relates :  
Description
The application starts failing with the following exception:

[glue.process.err] [stress.process.err] --------------------------------------------------------------------------------
[glue.process.err] [stress.process.err] SpecJbb2005StressModule got uncaught exception in init at Tue Nov 20 19:09:37 PST 2018 (1542769777652)
[glue.process.err] [stress.process.err] java.lang.IllegalAccessError: class jdk.internal.event.X509CertificateEvent (in module java.base) cannot access class jdk.jfr.internal.handlers.EventHandler (in module jdk.jfr) because module java.base does not read module jdk.jfr
[glue.process.err] [stress.process.err] 	at java.base/jdk.internal.event.X509CertificateEvent.shouldCommit(X509CertificateEvent.java)
[glue.process.err] [stress.process.err] 	at java.base/sun.security.provider.X509Factory.commitEvent(X509Factory.java:773)
[glue.process.err] [stress.process.err] 	at java.base/sun.security.provider.X509Factory.engineGenerateCertificate(X509Factory.java:108)
[glue.process.err] [stress.process.err] 	at java.base/java.security.cert.CertificateFactory.generateCertificate(CertificateFactory.java:355)
[glue.process.err] [stress.process.err] 	at java.base/sun.security.pkcs.PKCS7.parseSignedData(PKCS7.java:328)
[glue.process.err] [stress.process.err] 	at java.base/sun.security.pkcs.PKCS7.parse(PKCS7.java:186)
[glue.process.err] [stress.process.err] 	at java.base/sun.security.pkcs.PKCS7.parse(PKCS7.java:154)
[glue.process.err] [stress.process.err] 	at java.base/sun.security.pkcs.PKCS7.<init>(PKCS7.java:136)
[glue.process.err] [stress.process.err] 	at java.base/sun.security.util.SignatureFileVerifier.<init>(SignatureFileVerifier.java:127)
[glue.process.err] [stress.process.err] 	at java.base/java.util.jar.JarVerifier.processEntry(JarVerifier.java:297)
[glue.process.err] [stress.process.err] 	at java.base/java.util.jar.JarVerifier.update(JarVerifier.java:230)
[glue.process.err] [stress.process.err] 	at java.base/java.util.jar.JarFile.initializeVerifier(JarFile.java:758)
[glue.process.err] [stress.process.err] 	at java.base/java.util.jar.JarFile.getInputStream(JarFile.java:839)
[glue.process.err] [stress.process.err] 	at java.base/sun.net.www.protocol.jar.JarURLConnection.getInputStream(JarURLConnection.java:167)
[glue.process.err] [stress.process.err] 	at java.base/java.net.URLClassLoader.getResourceAsStream(URLClassLoader.java:293)
[glue.process.err] [stress.process.err] 	at applications.kitchensink.utils.Specjbb2005ClassLoader.loadClass(Specjbb2005ClassLoader.java:183)
[glue.process.err] [stress.process.err] 	at applications.kitchensink.process.stress.modules.SpecJbb2005StressModule.init(SpecJbb2005StressModule.java:111)
[glue.process.err] [stress.process.err] 	at applications.kitchensink.process.stress.modules.StressModule.run(StressModule.java:48)
[glue.process.err] [stress.process.err] --------------------------------------------------------------------------------
[glue.process.err] [stress.process.err] Iteration start: SpecJvm2008Batch at Tue Nov 20 19:09:38 PST 2018
[glue.process.err] [stress.process.err] Iteration start: SpecJvm2008Derby at Tue Nov 20 19:09:38 PST 2018
[glue.process.err] [stress.process.err] --------------------------------------------------------------------------------
[glue.process.err] [stress.process.err] SpecJvm2008DerbyStressModule got uncaught exception in execute at Tue Nov 20 19:09:39 PST 2018 (1542769779492)
[glue.process.err] [stress.process.err] java.lang.IllegalAccessError: class jdk.internal.event.X509CertificateEvent (in module java.base) cannot access class jdk.jfr.internal.handlers.EventHandler (in module jdk.jfr) because module java.base does not read module jdk.jfr
[glue.process.err] [stress.process.err] 	at java.base/jdk.internal.event.X509CertificateEvent.shouldCommit(X509CertificateEvent.java)
[glue.process.err] [stress.process.err] 	at java.base/sun.security.provider.X509Factory.commitEvent(X509Factory.java:773)
[glue.process.err] [stress.process.err] 	at java.base/sun.security.provider.X509Factory.engineGenerateCertificate(X509Factory.java:108)
[glue.process.err] [stress.process.err] 	at java.base/java.security.cert.CertificateFactory.generateCertificate(CertificateFactory.java:355)
[glue.process.err] [stress.process.err] 	at java.base/sun.security.pkcs.PKCS7.parseSignedData(PKCS7.java:328)
[glue.process.err] [stress.process.err] 	at java.base/sun.security.pkcs.PKCS7.parse(PKCS7.java:186)
[glue.process.err] [stress.process.err] 	at java.base/sun.security.pkcs.PKCS7.parse(PKCS7.java:154)
[glue.process.err] [stress.process.err] 	at java.base/sun.security.pkcs.PKCS7.<init>(PKCS7.java:136)
[glue.process.err] [stress.process.err] 	at java.base/sun.security.util.SignatureFileVerifier.<init>(SignatureFileVerifier.java:127)
[glue.process.err] [stress.process.err] 	at java.base/java.util.jar.JarVerifier.processEntry(JarVerifier.java:297)
[glue.process.err] [stress.process.err] 	at java.base/java.util.jar.JarVerifier.update(JarVerifier.java:230)
[glue.process.err] [stress.process.err] 	at java.base/java.util.jar.JarFile.initializeVerifier(JarFile.java:758)
[glue.process.err] [stress.process.err] 	at java.base/java.util.jar.JarFile.ensureInitialization(JarFile.java:1035)
[glue.process.err] [stress.process.err] 	at java.base/java.util.jar.JavaUtilJarAccessImpl.ensureInitialization(JavaUtilJarAccessImpl.java:69)
[glue.process.err] [stress.process.err] 	at java.base/jdk.internal.loader.URLClassPath$JarLoader$2.getManifest(URLClassPath.java:870)
[glue.process.err] [stress.process.err] 	at java.base/java.net.URLClassLoader.defineClass(URLClassLoader.java:482)
[glue.process.err] [stress.process.err] 	at java.base/java.net.URLClassLoader$1.run(URLClassLoader.java:423)
[glue.process.err] [stress.process.err] 	at java.base/java.net.URLClassLoader$1.run(URLClassLoader.java:417)
[glue.process.err] [stress.process.err] 	at java.base/java.security.AccessController.doPrivileged(AccessController.java:688)
[glue.process.err] [stress.process.err] 	at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:416)
[glue.process.err] [stress.process.err] 	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:588)
[glue.process.err] [stress.process.err] 	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
[glue.process.err] [stress.process.err] 	at applications.kitchensink.utils.GetOutUpdatingClassLoader.loadClass(GetOutUpdatingClassLoader.java:85)
[glue.process.err] [stress.process.err] 	at applications.kitchensink.process.stress.modules.SpecJvm2008StressModule.execute(SpecJvm2008StressModule.java:187)
[glue.process.err] [stress.process.err] 	at applications.kitchensink.process.stress.modules.StressModule.run(StressModule.java:66)
[glue.process.err] [stress.process.err] --------------------------------------------------------------------------------

Comments
Fix request: This fix is part of a series of JFR patches that Oracle have integrated into their 11.0.5 update. The series consists of JDK-8203629, JDK-8213172, JDK-8214161 and JDK-8148188. They all apply (in that order, with a little fuzz for JDK-8148188 in src/java.base/share/classes/java/security/Security.java) and tests at the SAP test system show no regressions. So requesting backport approval for 11u.
08-06-2019

This fix was picked up in jdk12-jdk.946 but the failure remains in the builds after. Are there other dependencies that needs to be updated as well, or did the fix not fix the issue?
24-11-2018

Current javap output for handler field: public final class jdk.internal.event.X509CertificateEvent extends jdk.internal.event.Event ... private static jdk.jfr.internal.handlers.EventHandler eventHandler; descriptor: Ljdk/jfr/internal/handlers/EventHandler; flags: (0x100a) ACC_PRIVATE, ACC_STATIC, ACC_SYNTHETIC Fixed javap output: public final class jdk.internal.event.X509CertificateEvent extends jdk.internal.event.Event ... private static java.lang.Object eventHandler; descriptor: Ljava/lang/Object; flags: (0x100a) ACC_PRIVATE, ACC_STATIC, ACC_SYNTHETIC Fix: diff -r c234c8696673 src/hotspot/share/jfr/instrumentation/jfrEventClassTransformer.cpp --- a/src/hotspot/share/jfr/instrumentation/jfrEventClassTransformer.cpp Thu Nov 22 12:08:13 2018 +0100 +++ b/src/hotspot/share/jfr/instrumentation/jfrEventClassTransformer.cpp Thu Nov 22 15:07:16 2018 +0100 @@ -447,6 +447,7 @@ if (registered_symbol == NULL) { registered_symbol = SymbolTable::lookup_only(registered_constant, sizeof registered_constant - 1, unused_hash); if (registered_symbol == NULL) { + untypedEventHandler = true; return false; } }
22-11-2018

The new events in java.base are using a new JFR enhancement from JDK-8203629. Need to check how this is triggered.
21-11-2018