java.lang.VerifyError: Cannot inherit from final class
horiavmuntean opened this issue · 2 comments
Hi,
While parsing a hotspot log (jitwatch is using zulu11.58.23-ca-jdk11.0.16.1-win_x64) jitwatch stopped with the following exception:
Exception in thread "Thread-3" java.lang.VerifyError: Cannot inherit from final class
at java.base/java.lang.ClassLoader.defineClass1(Native Method)
at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1017)
at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:174)
at java.base/java.net.URLClassLoader.defineClass(URLClassLoader.java:555)
at java.base/java.net.URLClassLoader$1.run(URLClassLoader.java:458)
at java.base/java.net.URLClassLoader$1.run(URLClassLoader.java:452)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:451)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:589)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:398)
at org.adoptopenjdk.jitwatch.util.ClassUtil.loadClassWithoutInitialising(ClassUtil.java:55)
at org.adoptopenjdk.jitwatch.util.ParseUtil.lateLoadMetaClass(ParseUtil.java:1115)
at org.adoptopenjdk.jitwatch.model.JITDataModel.findMetaMember(JITDataModel.java:257)
at org.adoptopenjdk.jitwatch.util.ParseUtil.findMemberWithSignature(ParseUtil.java:352)
at org.adoptopenjdk.jitwatch.parser.AbstractLogParser.findMemberWithSignature(AbstractLogParser.java:250)
at org.adoptopenjdk.jitwatch.parser.AbstractLogParser.handleMember(AbstractLogParser.java:576)
at org.adoptopenjdk.jitwatch.parser.AbstractLogParser.handleMethodLine(AbstractLogParser.java:479)
at org.adoptopenjdk.jitwatch.parser.AbstractLogParser.handleTagQueued(AbstractLogParser.java:373)
at org.adoptopenjdk.jitwatch.parser.hotspot.HotSpotLogParser.handleTag(HotSpotLogParser.java:356)
at org.adoptopenjdk.jitwatch.parser.hotspot.HotSpotLogParser.parseLogCompilationLines(HotSpotLogParser.java:154)
at org.adoptopenjdk.jitwatch.parser.hotspot.HotSpotLogParser.parseLogFile(HotSpotLogParser.java:130)
at org.adoptopenjdk.jitwatch.parser.AbstractLogParser.processLogFile(AbstractLogParser.java:366)
at org.adoptopenjdk.jitwatch.parser.ILogParser.processLogFile(ILogParser.java:23)
at org.adoptopenjdk.jitwatch.ui.main.JITWatchUI$1.run(JITWatchUI.java:253)
at java.base/java.lang.Thread.run(Thread.java:829)
I can't figure out how to go past this.
Thanks
The tool UI was started on windows as:
git clone https://github.com/AdoptOpenJDK/jitwatch.git
cd jitwatch
set java_home=C:\downloads\zulu11.58.23-ca-jdk11.0.16.1-win_x64\zulu11.58.23-ca-jdk11.0.16.1-win_x64
gradlew clean build run
The same exception is raised if the tool is run as : 'C:\downloads\zulu11.58.23-ca-jdk11.0.16.1-win_x64\zulu11.58.23-ca-jdk11.0.16.1-win_x64\bin\java -jar jitwatch-ui-1.4.7-shaded-win.jar'
The hotspot log that was loaded into the tools was produced by a java application running on linux in an OpenJDK Runtime Environment (Zulu 8.64.0.19-CA-linux64) (build 1.8.0_345-b01) JVM.
If I run jitwatch-ui-1.4.7-shaded-win.jar with java 17 as 'C:\downloads\zulu17.36.17-ca-jdk17.0.4.1-win_x64\zulu17.36.17-ca-jdk17.0.4.1-win_x64\bin\java -jar jitwatch-ui-1.4.7-shaded-win.jar' I get a different exception:
Exception in thread "Thread-3" java.lang.IncompatibleClassChangeError: class com.sun.naming.internal.VersionHelper12 cannot inherit from final class com.sun.naming.internal.VersionHelper
at java.base/java.lang.ClassLoader.defineClass1(Native Method)
at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1012)
at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:150)
at java.base/java.net.URLClassLoader.defineClass(URLClassLoader.java:524)
at java.base/java.net.URLClassLoader$1.run(URLClassLoader.java:427)
at java.base/java.net.URLClassLoader$1.run(URLClassLoader.java:421)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:712)
at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:420)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:587)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:467)
at org.adoptopenjdk.jitwatch.util.ClassUtil.loadClassWithoutInitialising(ClassUtil.java:55)
at org.adoptopenjdk.jitwatch.util.ParseUtil.lateLoadMetaClass(ParseUtil.java:1115)
at org.adoptopenjdk.jitwatch.model.JITDataModel.findMetaMember(JITDataModel.java:257)
at org.adoptopenjdk.jitwatch.util.ParseUtil.findMemberWithSignature(ParseUtil.java:352)
at org.adoptopenjdk.jitwatch.parser.AbstractLogParser.findMemberWithSignature(AbstractLogParser.java:250)
at org.adoptopenjdk.jitwatch.parser.AbstractLogParser.handleMember(AbstractLogParser.java:576)
at org.adoptopenjdk.jitwatch.parser.AbstractLogParser.handleMethodLine(AbstractLogParser.java:479)
at org.adoptopenjdk.jitwatch.parser.AbstractLogParser.handleTagQueued(AbstractLogParser.java:373)
at org.adoptopenjdk.jitwatch.parser.hotspot.HotSpotLogParser.handleTag(HotSpotLogParser.java:356)
at org.adoptopenjdk.jitwatch.parser.hotspot.HotSpotLogParser.parseLogCompilationLines(HotSpotLogParser.java:154)
at org.adoptopenjdk.jitwatch.parser.hotspot.HotSpotLogParser.parseLogFile(HotSpotLogParser.java:130)
at org.adoptopenjdk.jitwatch.parser.AbstractLogParser.processLogFile(AbstractLogParser.java:366)
at org.adoptopenjdk.jitwatch.parser.ILogParser.processLogFile(ILogParser.java:23)
at org.adoptopenjdk.jitwatch.ui.main.JITWatchUI$1.run(JITWatchUI.java:249)
at java.base/java.lang.Thread.run(Thread.java:833)
Hi @horiavmuntean ,
The current JITWatch design requires the classes referenced in the HotSpot log to be available and able to be loaded using a standard URLClassLoader. If your application uses classes that cannot be loaded in this way then JITWatch will complain and those classes won't appear in JITWatch. Could you provide the hotspot log you are trying to load?
Thanks,
Chris