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

Agent JAR loaded but agent failed to initialize #145

Open
cy503328434 opened this issue Feb 5, 2022 · 0 comments
Open

Agent JAR loaded but agent failed to initialize #145

cy503328434 opened this issue Feb 5, 2022 · 0 comments

Comments

@cy503328434
Copy link

一点文件信息的时候就报:Agent JAR loaded but agent failed to initialize

agent的jvm启动参数 :

-Dbistoury.local.host=192.168.91.1 -Dbistoury.proxy.host=192.168.91.128:9090 -Dbistoury.user.pid=18208 -Xbootclasspath/a:D:\JAVA\JDK\lib\tools.jar -Dbistoury.app.lib.class=org.springframework.web.servlet.DispatcherServlet -XX:-OmitStackTraceInFastThrow -Dbistoury.app.lib.class=org.springframework.web.servlet.DispatcherServlet -Dbistoury.agent.jar.path=F:\jvm\bistoury\bistoury-instrument-agent.jar -Dbistoury.arthas.core.jar.path=F:\jvm\arthas\arthas-core-3.1.4.jar

我自己应用的报错:

Exception in thread "Attach Listener" java.lang.reflect.InvocationTargetException
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:386)
	at sun.instrument.InstrumentationImpl.loadClassAndCallAgentmain(InstrumentationImpl.java:411)
Caused by: java.lang.RuntimeException: java.lang.IllegalStateException: illegal jar files, []
	at qunar.tc.bistoury.instrument.agent.AgentBootstrap2.main(AgentBootstrap2.java:280)
	at qunar.tc.bistoury.instrument.agent.AgentBootstrap2.agentmain(AgentBootstrap2.java:90)
	... 6 more
Caused by: java.lang.IllegalStateException: illegal jar files, []
	at qunar.tc.bistoury.instrument.agent.AgentBootstrap2.getJarFile(AgentBootstrap2.java:293)
	at qunar.tc.bistoury.instrument.agent.AgentBootstrap2.main(AgentBootstrap2.java:247)
	... 7 more
Agent failed to start!

agent的报错:

com.sun.tools.attach.AgentInitializationException: Agent JAR loaded but agent failed to initialize
	at sun.tools.attach.HotSpotVirtualMachine.loadAgent(HotSpotVirtualMachine.java:121) ~[na:na]
	at qunar.tc.bistoury.commands.arthas.ArthasStarter.attachAgent(ArthasStarter.java:99) ~[classes/:na]
	at qunar.tc.bistoury.commands.arthas.ArthasStarter.start(ArthasStarter.java:56) ~[classes/:na]
	at qunar.tc.bistoury.commands.arthas.ArthasEntity.start(ArthasEntity.java:38) ~[classes/:na]
	at qunar.tc.bistoury.commands.arthas.telnet.AbstractTelnetStore.forceCreateClient(AbstractTelnetStore.java:149) [classes/:na]
	at qunar.tc.bistoury.commands.arthas.telnet.AbstractTelnetStore.createClient(AbstractTelnetStore.java:141) [classes/:na]
	at qunar.tc.bistoury.commands.arthas.telnet.AbstractTelnetStore.doGetTelnet(AbstractTelnetStore.java:108) [classes/:na]
	at qunar.tc.bistoury.commands.arthas.telnet.AbstractTelnetStore.getTelnet(AbstractTelnetStore.java:53) [classes/:na]
	at qunar.tc.bistoury.commands.arthas.ArthasTask$Job.init(ArthasTask.java:118) [classes/:na]
	at qunar.tc.bistoury.agent.common.job.ForwardContinueResponseJob.init(ForwardContinueResponseJob.java:23) [classes/:na]
	at qunar.tc.bistoury.agent.common.job.DefaultResponseJobStore$WrappedJob.init(DefaultResponseJobStore.java:293) [classes/:na]
	at qunar.tc.bistoury.agent.common.job.DefaultResponseJobStore$PausedJob.init(DefaultResponseJobStore.java:133) [classes/:na]
	at qunar.tc.bistoury.agent.common.job.DefaultResponseJobStore$JobRunner.run(DefaultResponseJobStore.java:247) [classes/:na]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_311]
	at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:111) [guava-20.0.jar:na]
	at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:58) [guava-20.0.jar:na]
	at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:75) [guava-20.0.jar:na]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_311]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_311]
	at java.lang.Thread.run(Thread.java:748) [na:1.8.0_311]
[17:53:32 [log-agent-exec-2] INFO q.t.b.commands.arthas.ArthasStarter:60] - start attach to arthas agent
[17:53:32 [log-agent-exec-2] INFO q.t.b.commands.arthas.ArthasStarter:95] - start load arthas agent, input F:\jvm\bistoury\bistoury-instrument-agent.jar, load F:\jvm\bistoury\bistoury-instrument-agent.jar
[17:53:32 [log-agent-exec-2] ERRORq.t.b.commands.arthas.ArthasEntity:40] - start arthas error, pid [18208]
com.sun.tools.attach.AgentInitializationException: Agent JAR loaded but agent failed to initialize
	at sun.tools.attach.HotSpotVirtualMachine.loadAgent(HotSpotVirtualMachine.java:121) ~[na:na]
	at qunar.tc.bistoury.commands.arthas.ArthasStarter.attachAgent(ArthasStarter.java:99) ~[classes/:na]
	at qunar.tc.bistoury.commands.arthas.ArthasStarter.start(ArthasStarter.java:56) ~[classes/:na]
	at qunar.tc.bistoury.commands.arthas.ArthasEntity.start(ArthasEntity.java:38) ~[classes/:na]
	at qunar.tc.bistoury.commands.arthas.telnet.AbstractTelnetStore.forceCreateClient(AbstractTelnetStore.java:149) [classes/:na]
	at qunar.tc.bistoury.commands.arthas.telnet.AbstractTelnetStore.doGetTelnet(AbstractTelnetStore.java:110) [classes/:na]
	at qunar.tc.bistoury.commands.arthas.telnet.AbstractTelnetStore.getTelnet(AbstractTelnetStore.java:53) [classes/:na]
	at qunar.tc.bistoury.commands.arthas.ArthasTask$Job.init(ArthasTask.java:118) [classes/:na]
	at qunar.tc.bistoury.agent.common.job.ForwardContinueResponseJob.init(ForwardContinueResponseJob.java:23) [classes/:na]
	at qunar.tc.bistoury.agent.common.job.DefaultResponseJobStore$WrappedJob.init(DefaultResponseJobStore.java:293) [classes/:na]
	at qunar.tc.bistoury.agent.common.job.DefaultResponseJobStore$PausedJob.init(DefaultResponseJobStore.java:133) [classes/:na]
	at qunar.tc.bistoury.agent.common.job.DefaultResponseJobStore$JobRunner.run(DefaultResponseJobStore.java:247) [classes/:na]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_311]
	at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:111) [guava-20.0.jar:na]
	at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:58) [guava-20.0.jar:na]
	at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:75) [guava-20.0.jar:na]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_311]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_311]
	at java.lang.Thread.run(Thread.java:748) [na:1.8.0_311]
[17:53:32 [log-agent-exec-5] ERRORq.t.b.remoting.netty.TaskProcessor:106] - arthas command error, id [220205.175330.192.168.91.128.23931.2544], command [appconfig -pid18208]

用户目录下logs/arthas的日志:

2022-02-05 14:14:43 [arthas-NettyHttpTelnetBootstrap-3-2] INFO  c.t.a.core.shell.term.impl.Helper -Loaded arthas keymap file from com/taobao/arthas/core/shell/term/readline/inputrc
bistoury server agent start...
java.lang.IllegalStateException: illegal jar files, [D:\develop\maven\repository\com\taobao\arthas\arthas-core\3.1.4\arthas-core-3.1.4-sources.jar, D:\develop\maven\repository\com\taobao\arthas\arthas-core\3.1.4\arthas-core-3.1.4-sources.jar.sha1, D:\develop\maven\repository\com\taobao\arthas\arthas-core\3.1.4\arthas-core-3.1.4.jar, D:\develop\maven\repository\com\taobao\arthas\arthas-core\3.1.4\arthas-core-3.1.4.jar.sha1, D:\develop\maven\repository\com\taobao\arthas\arthas-core\3.1.4\arthas-core-3.1.4.pom, D:\develop\maven\repository\com\taobao\arthas\arthas-core\3.1.4\arthas-core-3.1.4.pom.sha1]
	at qunar.tc.bistoury.instrument.agent.AgentBootstrap2.getJarFile(AgentBootstrap2.java:293)
	at qunar.tc.bistoury.instrument.agent.AgentBootstrap2.main(AgentBootstrap2.java:244)
	at qunar.tc.bistoury.instrument.agent.AgentBootstrap2.agentmain(AgentBootstrap2.java:90)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:386)
	at sun.instrument.InstrumentationImpl.loadClassAndCallAgentmain(InstrumentationImpl.java:411)
bistoury server agent start...
java.lang.IllegalStateException: illegal jar files, []
	at qunar.tc.bistoury.instrument.agent.AgentBootstrap2.getJarFile(AgentBootstrap2.java:293)
	at qunar.tc.bistoury.instrument.agent.AgentBootstrap2.main(AgentBootstrap2.java:247)
	at qunar.tc.bistoury.instrument.agent.AgentBootstrap2.agentmain(AgentBootstrap2.java:90)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:386)
	at sun.instrument.InstrumentationImpl.loadClassAndCallAgentmain(InstrumentationImpl.java:411)
bistoury server agent start...
java.lang.IllegalStateException: illegal jar files, []
	at qunar.tc.bistoury.instrument.agent.AgentBootstrap2.getJarFile(AgentBootstrap2.java:293)
	at qunar.tc.bistoury.instrument.agent.AgentBootstrap2.main(AgentBootstrap2.java:247)
	at qunar.tc.bistoury.instrument.agent.AgentBootstrap2.agentmain(AgentBootstrap2.java:90)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:386)
	at sun.instrument.InstrumentationImpl.loadClassAndCallAgentmain(InstrumentationImpl.java:411)
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

1 participant