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

执行trace命令抛异常,Enhancer error,java.lang.ClassFormatError: null #1506

Closed
1 task done
hhzhong opened this issue Sep 17, 2020 · 10 comments
Closed
1 task done

Comments

@hhzhong
Copy link

hhzhong commented Sep 17, 2020

  • 我已经在 issues 里搜索,没有重复的issue。

环境信息

  • arthas-boot.jar 或者 as.sh 的版本: xxx
  • Arthas 版本: xxx
  • 操作系统版本: Red Hat Enterprise Linux Server release 6.6 (Santiago)
  • 目标进程的JVM版本: java version "1.8.0_172-ea"
  • 执行arthas-boot的版本: arthas-boot version: 3.3.3

重现问题的步骤

  1. trace com.sf.nwms.inventory.inv.service.impl.InvQueryServiceImpl queryLocationInvList
  2. xxx
  3. xxx

期望的结果

What do you expected from the above steps?

实际运行的结果

实际运行结果,最好有详细的日志,异常栈。尽量贴文本。

把异常信息贴到这里
2020-09-17 10:11:45 [arthas-binding-thread] INFO  c.t.a.core.server.ArthasBootstrap -as-server started in 713 ms
Arthas server already bind.
2020-09-17 10:11:45 [nioEventLoopGroup-2-1] INFO  i.n.handler.logging.LoggingHandler -[id: 0xc391befe, L:/127.0.0.1:3658] READ: [id: 0x4a940d78, L:/127.0.0.1:3658 - R:/127.0.0.1:48184]
2020-09-17 10:11:45 [nioEventLoopGroup-2-1] INFO  i.n.handler.logging.LoggingHandler -[id: 0xc391befe, L:/127.0.0.1:3658] READ COMPLETE
2020-09-17 10:11:46 [nioEventLoopGroup-2-2] INFO  c.t.a.core.shell.term.impl.Helper -Loaded arthas keymap file from com/taobao/arthas/core/shell/term/readline/inputrc
2020-09-17 10:12:18 [as-command-execute-daemon] INFO  c.t.arthas.core.advisor.Enhancer -enhance matched classes: [class com.sf.nwms.inventory.inv.service.impl.InvQueryServiceImpl$$EnhancerBySpringCGLIB$$ce393cee, class com.sf.nwms.inventory.inv.service.impl.InvQueryServiceImpl]
2020-09-17 10:12:18 [as-command-execute-daemon] ERROR c.t.arthas.core.advisor.Enhancer -Enhancer error, matchingClasses: [class com.sf.nwms.inventory.inv.service.impl.InvQueryServiceImpl$$EnhancerBySpringCGLIB$$ce393cee, class com.sf.nwms.inventory.inv.service.impl.InvQueryServiceImpl]
java.lang.ClassFormatError: null
        at sun.instrument.InstrumentationImpl.retransformClasses0(Native Method)
        at sun.instrument.InstrumentationImpl.retransformClasses(InstrumentationImpl.java:144)
        at com.taobao.arthas.core.advisor.Enhancer.enhance(Enhancer.java:366)
        at com.taobao.arthas.core.command.monitor200.EnhancerCommand.enhance(EnhancerCommand.java:135)
        at com.taobao.arthas.core.command.monitor200.EnhancerCommand.process(EnhancerCommand.java:87)
        at com.taobao.arthas.core.shell.command.impl.AnnotatedCommandImpl.process(AnnotatedCommandImpl.java:82)
        at com.taobao.arthas.core.shell.command.impl.AnnotatedCommandImpl.access$100(AnnotatedCommandImpl.java:18)
        at com.taobao.arthas.core.shell.command.impl.AnnotatedCommandImpl$ProcessHandler.handle(AnnotatedCommandImpl.java:111)
        at com.taobao.arthas.core.shell.command.impl.AnnotatedCommandImpl$ProcessHandler.handle(AnnotatedCommandImpl.java:108)
        at com.taobao.arthas.core.shell.system.impl.ProcessImpl$CommandProcessTask.run(ProcessImpl.java:372)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)
2020-09-17 10:35:30 [nioEventLoopGroup-2-2] INFO  c.t.a.c.shell.impl.ShellServerImpl -Session fe4e4490-de78-42f7-8080-69aad0e522a3 closed, so terminate foreground job, id: 1, line: trace com.sf.nwms.inventory.inv
@hhzhong
Copy link
Author

hhzhong commented Sep 17, 2020

Spring Boot :: (v2.1.9.RELEASE)

@hengyunabc
Copy link
Collaborator

在 issue里搜下相关的,参考下

@hhzhong
Copy link
Author

hhzhong commented Sep 17, 2020

搜过,有个类似的internal error,但没看到解决办法,可以帮排查下吗?

@hengyunabc
Copy link
Collaborator

#1141

@hengyunabc
Copy link
Collaborator

@hhzhong 可以测试下这个版本: #1526 (comment) ,解压,cd进目录启动。

@hengyunabc
Copy link
Collaborator

试下最新的 3.4.3 版本,应该已经修复了。

@kylixs
Copy link
Contributor

kylixs commented Sep 30, 2020

这个错误是什么问题?没有任何信息

@kowhi
Copy link

kowhi commented Dec 18, 2020

我也有同样的问题。
arthas version 3.4.5
腾讯云环境:CentOS Linux release 7.9.2009 (Core)
java version "1.8.0_251"

command: trace com.xxx.orderscenicspots.biz.service.impl.MainOrderServiceImpl saveCreateOrderResult
Affect(class count: 1 , method count: 1) cost in 52 ms, listenerId: 5
Enhance error! exception: java.lang.ClassFormatError
error happens when enhancing class: null, check arthas log: /root/logs/arthas/arthas.log
日志如下:

2020-12-18 10:53:30 [arthas-NettyHttpTelnetBootstrap-3-1] INFO c.a.a.d.i.n.h.logging.LoggingHandler -[id: 0x52762a84, L:/127.0.0.1:3658] READ: [id: 0x230c3f1b, L:/127.0.0.1:3658 - R:/127.0.0.1:46626]
2020-12-18 10:53:30 [arthas-NettyHttpTelnetBootstrap-3-1] INFO c.a.a.d.i.n.h.logging.LoggingHandler -[id: 0x52762a84, L:/127.0.0.1:3658] READ COMPLETE
2020-12-18 10:53:30 [arthas-NettyHttpTelnetBootstrap-3-3] INFO c.t.a.core.shell.term.impl.Helper -Loaded arthas keymap file from com/taobao/arthas/core/shell/term/readline/inputrc
Arthas server already stared, skip attach.
2020-12-18 10:53:31 [arthas-NettyHttpTelnetBootstrap-3-1] INFO c.a.a.d.i.n.h.logging.LoggingHandler -[id: 0x52762a84, L:/127.0.0.1:3658] READ: [id: 0x90080e08, L:/127.0.0.1:3658 - R:/127.0.0.1:46652]
2020-12-18 10:53:31 [arthas-NettyHttpTelnetBootstrap-3-1] INFO c.a.a.d.i.n.h.logging.LoggingHandler -[id: 0x52762a84, L:/127.0.0.1:3658] READ COMPLETE
2020-12-18 10:53:31 [arthas-NettyHttpTelnetBootstrap-3-4] INFO c.t.a.core.shell.term.impl.Helper -Loaded arthas keymap file from com/taobao/arthas/core/shell/term/readline/inputrc
2020-12-18 10:53:43 [arthas-command-execute] INFO c.t.arthas.core.advisor.Enhancer -enhance matched classes: [class com.xxxx.orderscenicspots.biz.service.impl.MainOrderServiceImpl, class com.xxxx.orderscenicspots.biz.service.impl.MainOrderServiceImpl$$EnhancerBySpringCGLIB$$4252ddc2]
2020-12-18 10:53:43 [arthas-command-execute] ERROR c.t.arthas.core.advisor.Enhancer -Enhancer error, matchingClasses: [class com.xxxx.orderscenicspots.biz.service.impl.MainOrderServiceImpl, class com.xxxx.orderscenicspots.biz.service.impl.MainOrderServiceImpl$$EnhancerBySpringCGLIB$$4252ddc2]
java.lang.ClassFormatError: null
at sun.instrument.InstrumentationImpl.retransformClasses0(Native Method)
at sun.instrument.InstrumentationImpl.retransformClasses(InstrumentationImpl.java:144)
at com.taobao.arthas.core.advisor.Enhancer.enhance(Enhancer.java:372)
at com.taobao.arthas.core.command.monitor200.EnhancerCommand.enhance(EnhancerCommand.java:149)
at com.taobao.arthas.core.command.monitor200.EnhancerCommand.process(EnhancerCommand.java:96)
at com.taobao.arthas.core.shell.command.impl.AnnotatedCommandImpl.process(AnnotatedCommandImpl.java:82)
at com.taobao.arthas.core.shell.command.impl.AnnotatedCommandImpl.access$100(AnnotatedCommandImpl.java:18)
at com.taobao.arthas.core.shell.command.impl.AnnotatedCommandImpl$ProcessHandler.handle(AnnotatedCommandImpl.java:111)
at com.taobao.arthas.core.shell.command.impl.AnnotatedCommandImpl$ProcessHandler.handle(AnnotatedCommandImpl.java:108)
at com.taobao.arthas.core.shell.system.impl.ProcessImpl$CommandProcessTask.run(ProcessImpl.java:385)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)

@hengyunabc
Copy link
Collaborator

@kowhi 最好能提供可重现的demo,参考 #1141 ,看有没有其它的 java agent。

@zhumengguang
Copy link

@hengyunabc 我也遇到了这样的问题,系统存在skywalking-agent监控,这个如何解决呢?

2023-03-31 15:20:46 [arthas-command-execute] ERROR c.t.arthas.core.advisor.Enhancer -Enhancer error, matchingClasses: [class com.test.TestController]
java.lang.ClassFormatError: null
at sun.instrument.InstrumentationImpl.retransformClasses0(Native Method)
at sun.instrument.InstrumentationImpl.retransformClasses(InstrumentationImpl.java:144)
at com.taobao.arthas.core.advisor.Enhancer.enhance(Enhancer.java:446)
at com.taobao.arthas.core.command.monitor200.EnhancerCommand.enhance(EnhancerCommand.java:162)
at com.taobao.arthas.core.command.monitor200.EnhancerCommand.process(EnhancerCommand.java:109)
at com.taobao.arthas.core.shell.command.impl.AnnotatedCommandImpl.process(AnnotatedCommandImpl.java:82)
at com.taobao.arthas.core.shell.command.impl.AnnotatedCommandImpl.access$100(AnnotatedCommandImpl.java:18)
at com.taobao.arthas.core.shell.command.impl.AnnotatedCommandImpl$ProcessHandler.handle(AnnotatedCommandImpl.java:111)
at com.taobao.arthas.core.shell.command.impl.AnnotatedCommandImpl$ProcessHandler.handle(AnnotatedCommandImpl.java:108)
at com.taobao.arthas.core.shell.system.impl.ProcessImpl$CommandProcessTask.run(ProcessImpl.java:385)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)

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

5 participants