Jacoco 0.8.8 and Java 17 using J9/Semeru VM

113 views
Skip to first unread message

Aaron Dutenhoefer

unread,
Aug 16, 2022, 3:18:53 PM8/16/22
to JaCoCo and EclEmma Users
Hello,  in the process of updating our environment to the latest version of Java, we've found an issue with the latest version of JaCoCo and the J9/Semeru VM.  When trying to run the jacoco:merge target of our builds, we're getting the error below.

If we switch to the HotSpot/Temurin VM, the tests pass and the coverage reports are produced as expected.

We ran into a similar issue with 0.8.5 and the J9 VM.  In that instance, reverting to 0.8.2 and adding some Xbootclasspath/a: entries to the startup configuration for JBoss fixed the issue.  That's not an option for Java 17 as we need 0.8.8 to support it, at least according to the docs.  

Have we once again bumped into an incompatibility between JaCoCo and the J9 VM?

Thanks,
-a

Error StackTrace when trying to start JBoss (WildFly v26.1.1)
Exception in thread "main" java.lang.NoClassDefFoundError: java.lang.$JaCoCo
        at org.jboss.as.jmx<atSign>18.1.1.Final//org.jboss.as.jmx.PluggableMBeanServerBuilder.$jacocoInit(PluggableMBeanServerBuilder.java)
        at org.jboss.as.jmx<atSign>18.1.1.Final//org.jboss.as.jmx.PluggableMBeanServerBuilder.<init>(PluggableMBeanServerBuilder.java)
        at java.base/java.lang.J9VMInternals.newInstanceImpl(Native Method)
        at java.base/java.lang.Class.newInstance(Class.java:2353)
        at java.management/javax.management.MBeanServerFactory.newBuilder(MBeanServerFactory.java:461)
        at java.management/javax.management.MBeanServerFactory.checkMBeanServerBuilder(MBeanServerFactory.java:499)
        at java.management/javax.management.MBeanServerFactory.getNewMBeanServerBuilder(MBeanServerFactory.java:537)
        at java.management/javax.management.MBeanServerFactory.newMBeanServer(MBeanServerFactory.java:316)
        at java.management/javax.management.MBeanServerFactory.createMBeanServer(MBeanServerFactory.java:231)
        at java.management/javax.management.MBeanServerFactory.createMBeanServer(MBeanServerFactory.java:192)
        at java.management/java.lang.management.ManagementFactory.getPlatformMBeanServer(ManagementFactory.java:484)
        at org.jboss.modules.Main.main(Main.java:545)
Caused by: java.lang.ClassNotFoundException: java.lang.$JaCoCo from [Module "org.jboss.as.jmx" version 18.1.1.Final from local module loader @c531709d (finder: local module finder @13efed7d (roots: C:\Development\WildFly\modules,C:\Development\WildFly\modules\system\layers\base))]
        at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:200)
        at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:410)
        at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)
        at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:116)
        ... 12 more

Evgeny Mandrikov

unread,
Nov 16, 2022, 8:40:27 AM11/16/22
to JaCoCo and EclEmma Users
Hi,

You can add "java.lang" to WildFly property "jboss.modules.system.pkgs"

In standalone.conf its default value is "org.jboss.byteman",
so that JAVA_OPTS when executing standalone.sh contains

-Djboss.modules.system.pkgs=org.jboss.byteman

And indeed freshly downloaded WildFly v27.0.0 fails to start with JaCoCo 0.8.8 on J9/Semeru VM.
After the addition of "java.lang" to this property

-Djboss.modules.system.pkgs=org.jboss.byteman,java.lang

it starts successfully.
Reply all
Reply to author
Forward
0 new messages