Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

使用jdk11后,启动LinkAgent报错Caused by: java.lang.ClassFormatError: Nest-host class_info_index 53 has bad constant type in class file sun/jvmstat/perfdata/monitor/protocol/local/MonitoredHostProvider$NotifierTask #198

Open
runli471872316 opened this issue May 5, 2022 · 2 comments

Comments

@runli471872316
Copy link

2022-05-05 12:36:56 ERROR AGENT: prepare to start agent failed.
at jdk.attach/sun.tools.attach.HotSpotAttachProvider.listVirtualMachines(HotSpotAttachProvider.java:83)
at jdk.attach/com.sun.tools.attach.VirtualMachine.list(VirtualMachine.java:146)
at com.shulie.instrument.simulator.agent.core.AgentLauncher.start0(AgentLauncher.java:132)
at com.shulie.instrument.simulator.agent.core.AgentLauncher.startup(AgentLauncher.java:249)
at com.shulie.instrument.simulator.agent.core.CoreLauncher$3$1.execute(CoreLauncher.java:201)
at com.shulie.instrument.simulator.agent.spi.impl.HttpAgentScheduler.install(HttpAgentScheduler.java:206)
at com.shulie.instrument.simulator.agent.spi.impl.HttpAgentScheduler.installLocal(HttpAgentScheduler.java:313)
at com.shulie.instrument.simulator.agent.spi.impl.HttpAgentScheduler.start(HttpAgentScheduler.java:282)
at com.shulie.instrument.simulator.agent.core.CoreLauncher$3.run(CoreLauncher.java:226)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.ClassFormatError: Nest-host class_info_index 53 has bad constant type in class file sun/jvmstat/perfdata/monitor/protocol/local/MonitoredHostProvider$NotifierTask
at java.base/java.lang.ClassLoader.defineClass2(Native Method)
at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1108)
at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:206)
at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:759)
at java.base/jdk.internal.loader.BuiltinClassLoader.findClassInModuleOrNull(BuiltinClassLoader.java:680)
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:605)
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:579)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
at jdk.internal.jvmstat/sun.jvmstat.perfdata.monitor.protocol.local.MonitoredHostLocalService.getMonitoredHost(MonitoredHostLocalService.java:38)
at jdk.internal.jvmstat/sun.jvmstat.monitor.MonitoredHost.getMonitoredHost(MonitoredHost.java:172)
at jdk.attach/sun.tools.attach.HotSpotAttachProvider.listVirtualMachines(HotSpotAttachProvider.java:71)
... 14 common frames omitted

@yriiolik
Copy link
Collaborator

yriiolik commented May 5, 2022

Nest-host class_info_index 53 has bad const

jdk版本不一致造成的。 启动参数指定了 tools.jar 的位置吧?

试试看把 tools.jar 的参数去掉;或者用 -Dsimulator.use.premain=true 参数来指定一下启动模式。

@runli471872316
Copy link
Author

Nest-host class_info_index 53 has bad const

jdk版本不一致造成的。 启动参数指定了 tools.jar 的位置吧?

试试看把 tools.jar 的参数去掉;或者用 -Dsimulator.use.premain=true 参数来指定一下启动模式。

jdk11目录没有 tools.jar,我配置了JAVA_OPTS="${JAVA_OPTS} -Xbootclasspath/a:$JAVA_HOME/lib.tools.jar"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants