Closed zhouxihua0311 closed 5 years ago
试下 arthas-demo 。 看下 ~/logs/arthas/arthas.log 的内容。 试下启动一个新的进程再来attach。
试下 arthas-demo 。 看下 ~/logs/arthas/arthas.log 的内容。 试下启动一个新的进程再来attach。
下面是 ~/logs/arthas/arthas.log 的内容, Arthas server agent start... Arthas start to bind... 01 2019-05-14 21:25:00.757 INFO [arthas-binding-thread:arthas] [] [] [] arthas version: 3.1.0 01 2019-05-14 21:25:00.943 INFO [nioEventLoopGroup-2-1:i.n.h.l.LoggingHandler] [id: 0x655f4f6f] REGISTERED 01 2019-05-14 21:25:00.946 INFO [nioEventLoopGroup-2-1:i.n.h.l.LoggingHandler] [id: 0x655f4f6f] BIND: /127.0.0.1:3658 01 2019-05-14 21:25:00.949 INFO [nioEventLoopGroup-2-1:i.n.h.l.LoggingHandler] [id: 0x655f4f6f, L:/127.0.0.1:3658] ACTIVE 01 2019-05-14 21:25:00.952 INFO [nioEventLoopGroup-3-1:i.n.h.l.LoggingHandler] [id: 0x25b5983e] REGISTERED 01 2019-05-14 21:25:00.952 INFO [nioEventLoopGroup-3-1:i.n.h.l.LoggingHandler] [id: 0x25b5983e] BIND: /127.0.0.1:8563 01 2019-05-14 21:25:00.952 INFO [nioEventLoopGroup-3-1:i.n.h.l.LoggingHandler] [id: 0x25b5983e, L:/127.0.0.1:8563] ACTIVE 01 2019-05-14 21:25:00.953 INFO [arthas-binding-thread:arthas] [as-server listening on network=3658;telnet=8563;http=6000;timeout={};] [] [] 127.0.0.1 01 2019-05-14 21:25:00.959 INFO [arthas-binding-thread:arthas] [] [] [] as-server started in 239 ms Arthas server bind success. 01 2019-05-14 21:25:01.071 INFO [nioEventLoopGroup-2-1:i.n.h.l.LoggingHandler] [id: 0x655f4f6f, L:/127.0.0.1:3658] READ: [id: 0xf6db2923, L:/127.0.0.1:3658 - R:/127.0.0.1:61265] 01 2019-05-14 21:25:01.072 INFO [nioEventLoopGroup-2-1:i.n.h.l.LoggingHandler] [id: 0x655f4f6f, L:/127.0.0.1:3658] READ COMPLETE 01 2019-05-14 21:25:01.110 INFO [nioEventLoopGroup-2-2:arthas] [] [] [] Loaded arthas keymap file from com/taobao/arthas/core/shell/term/readline/inputrc Arthas server agent start... Arthas start to bind... 01 2019-05-14 21:36:51.401 INFO [arthas-binding-thread:arthas] [] [] [] arthas version: 3.1.0 01 2019-05-14 21:36:52.037 INFO [nioEventLoopGroup-2-1:i.n.h.l.LoggingHandler] [id: 0x016a1eba] REGISTERED 01 2019-05-14 21:36:52.040 INFO [nioEventLoopGroup-2-1:i.n.h.l.LoggingHandler] [id: 0x016a1eba] BIND: /127.0.0.1:3658 01 2019-05-14 21:36:52.061 INFO [nioEventLoopGroup-2-1:i.n.h.l.LoggingHandler] [id: 0x016a1eba, L:/127.0.0.1:3658] ACTIVE 01 2019-05-14 21:36:52.064 INFO [nioEventLoopGroup-3-1:i.n.h.l.LoggingHandler] [id: 0x77983c74] REGISTERED 01 2019-05-14 21:36:52.064 INFO [nioEventLoopGroup-3-1:i.n.h.l.LoggingHandler] [id: 0x77983c74] BIND: /127.0.0.1:8563 01 2019-05-14 21:36:52.064 INFO [nioEventLoopGroup-3-1:i.n.h.l.LoggingHandler] [id: 0x77983c74, L:/127.0.0.1:8563] ACTIVE 01 2019-05-14 21:36:52.067 INFO [arthas-binding-thread:arthas] [as-server listening on network=3658;telnet=8563;http=6000;timeout={};] [] [] 127.0.0.1 01 2019-05-14 21:36:52.071 INFO [arthas-binding-thread:arthas] [] [] [] as-server started in 744 ms Arthas server bind success. 01 2019-05-14 21:36:52.204 INFO [nioEventLoopGroup-2-1:i.n.h.l.LoggingHandler] [id: 0x016a1eba, L:/127.0.0.1:3658] READ: [id: 0x1d77dd2e, L:/127.0.0.1:3658 - R:/127.0.0.1:61509] 01 2019-05-14 21:36:52.206 INFO [nioEventLoopGroup-2-1:i.n.h.l.LoggingHandler] [id: 0x016a1eba, L:/127.0.0.1:3658] READ COMPLETE 01 2019-05-14 21:36:52.266 INFO [nioEventLoopGroup-2-2:arthas] [] [] [] Loaded arthas keymap file from com/taobao/arthas/core/shell/term/readline/inputrc 01 2019-05-14 21:42:50.768 INFO [nioEventLoopGroup-2-1:i.n.h.l.LoggingHandler] [id: 0x016a1eba, L:/127.0.0.1:3658] READ: [id: 0x80236b48, L:/127.0.0.1:3658 - R:/127.0.0.1:61662] 01 2019-05-14 21:42:50.768 INFO [nioEventLoopGroup-2-1:i.n.h.l.LoggingHandler] [id: 0x016a1eba, L:/127.0.0.1:3658] READ COMPLETE 01 2019-05-14 21:42:50.770 INFO [nioEventLoopGroup-2-3:arthas] [] [] [] Loaded arthas keymap file from com/taobao/arthas/core/shell/term/readline/inputrc 01 2019-05-14 21:43:32.119 INFO [nioEventLoopGroup-2-2:arthas] [] [] [] Session 5dcbeab3-a7b5-488d-8eee-1279f2dd99f9 closed, so terminate foreground job, id: 1, line: trace 01 2019-05-14 21:44:50.510 INFO [as-shutdown-hooker:arthas] [] [] [] as-server destroy completed.
这是我本地应用启的是sofaweb,attach报错日志 Exception in thread "Attach Listener" java.lang.ClassNotFoundException: com.taobao.arthas.agent.AgentBootstrap at java.net.URLClassLoader.findClass(URLClassLoader.java:381) at com.alipay.sofa.runtime.test.classloader.FwkClassLoader.findClass(FwkClassLoader.java:139) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) at sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:304) at sun.instrument.InstrumentationImpl.loadClassAndCallAgentmain(InstrumentationImpl.java:411) Agent failed to start!
这个是实现方的FwkClassLoader
代码问题,需要处理agent jar。
FwkClassLoader 里的代码没能加载 agent jar里的内容,agent jar是被 system classloader加载的。它没有处理,然后agent加载失败。
我也遇到了类似的问题,该怎么解决呢
[ERROR] Start arthas failed, exception stack trace:
com.sun.tools.attach.AgentInitializationException: Agent JAR loaded but agent failed to initialize
at sun.tools.attach.HotSpotVirtualMachine.loadAgent(HotSpotVirtualMachine.java:121)
at com.taobao.arthas.core.Arthas.attachAgent(Arthas.java:104)
at com.taobao.arthas.core.Arthas.<init>(Arthas.java:28)
at com.taobao.arthas.core.Arthas.main(Arthas.java:123)
[ERROR] attach fail, targetPid: 19937
+1 请问怎么解
环境信息 arthas-boot.jar 或者 as.sh 的版本: 3.2.0 Arthas 版本: 3.2.0 操作系统版本: CentOS 6.7 目标进程的JVM版本: 1.6.0_27 64Bit 错误说明及截图 需要诊断的进程ID是19178,加载报错;但其父进程 19137可以正常加载!希望这个信息能有所帮助
我遇到类似的问题,原因是的arthas路径带中文了,换到其他路径就可以了
+1 请问怎么解
+1
+1
环境信息
arthas-boot.jar
或者as.sh
的版本: xxxarthas-boot
的版本: xxx重现问题的步骤
期望的结果
What do you expected from the above steps?
实际运行的结果
实际运行结果,最好有详细的日志,异常栈。尽量贴文本。
[ERROR] Start arthas failed, exception stack trace: com.sun.tools.attach.AgentInitializationException: Agent JAR loaded but agent failed to initialize at sun.tools.attach.HotSpotVirtualMachine.loadAgent(HotSpotVirtualMachine.java:121) at com.taobao.arthas.core.Arthas.attachAgent(Arthas.java:88) at com.taobao.arthas.core.Arthas.(Arthas.java:26)
at com.taobao.arthas.core.Arthas.main(Arthas.java:100)