[alibaba/arthas]watch命令报错class redefinition failed: attempted to change the schema (add/remove fields)

2024-07-09 496 views
0
环境信息
  • arthas-boot.jar 或者 as.sh 的版本: xxx
  • Arthas 版本: 3.5.2
  • 操作系统版本: Linux version 3.10.0-1127.13.1.el7.x86_64 (mockbuild@kbuilder.bsys.centos.org) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-39) (GCC) ) #1 SMP Tue Jun 23 15:46:38 UTC 2020
  • 目标进程的JVM版本: java version "1.8.0_251" Java(TM) SE Runtime Environment (build 1.8.0_251-b08) Java HotSpot(TM) 64-Bit Server VM (build 25.251-b08, mixed mode) [apprun@yungehuo-test-001 data]$ cat /proc/version
  • 执行arthas-boot的版本: xxx
重现问题的步骤
  1. watch命令查看方法返回参数,直接报错 [arthas@16943]$ watch xx.xx.controller receive '{params,returnObj.data,throwExp}' -v -n 5 -x 2 Affect(class count: 1 , method count: 1) cost in 47 ms, listenerId: 3 Enhance error! exception: java.lang.UnsupportedOperationException: class redefinition failed: attempted to change the schema (add/remove fields) error happens when enhancing class: class redefinition failed: attempted to change the schema (add/remove fields), check arthas log: /home/apprun/logs/arthas/arthas.log

  2. 查看arthas日志 [arthas-command-execute] ERROR c.t.arthas.core.advisor.Enhancer -Enhancer error, matchingClasses: [class xx.xx.controller] java.lang.UnsupportedOperationException: class redefinition failed: attempted to change the schema (add/remove fields) 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:396) at com.taobao.arthas.core.command.monitor200.EnhancerCommand.enhance(EnhancerCommand.java:168) at com.taobao.arthas.core.command.monitor200.EnhancerCommand.process(EnhancerCommand.java:115) 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)

  3. xxx

期望的结果

watch能够正常查看

实际运行的结果

实际运行结果,最好有详细的日志,异常栈。尽量贴文本。 如上arthas日志显示及watch命令执行

把异常信息贴到这里 如上arthas日志显示及watch命令执行

回答

5

操作系统版本为:Red Hat 4.8.5-39