[alibaba/arthas]arthas watch命令导致了方法执行报错

2023-12-12 701 views
2
环境信息
  • arthas-boot.jar 或者 as.sh 的版本: 3.6.9
  • Arthas 版本: 3.6.9
  • 操作系统版本: Linux n250-048-043 4.14.81.bm.26-amd64 #1 SMP Debian 4.14.81.bm.26 Mon Sep 14 09:46:45 UTC 2020 x86_64 GNU/Linux
  • 目标进程的JVM版本: jdk1.8.0_181
  • 执行arthas-boot的版本: jdk1.8.0_181
重现问题的步骤
  1. watch com.xxx.Client getById '{target.getById("a", 1L)}'
期望的结果

What do you expected from the above steps? 能够看到getById("a", 1L)返回值或异常报错

实际运行的结果

image 被watch的方法无法正常工作,一直在报错Could not initialize class com.alibaba.arthas.deps.ch.qos.logback.classic.spi.ThrowableProxy

Caused by: java.lang.NoClassDefFoundError: Could not initialize class com.alibaba.arthas.deps.ch.qos.logback.classic.spi.ThrowableProxy
        at com.alibaba.arthas.deps.ch.qos.logback.classic.spi.LoggingEvent.<init>(LoggingEvent.java:119)
        at com.alibaba.arthas.deps.ch.qos.logback.classic.Logger.buildLoggingEventAndAppend(Logger.java:419)
        at com.alibaba.arthas.deps.ch.qos.logback.classic.Logger.filterAndLog_0_Or3Plus(Logger.java:383)
        at com.alibaba.arthas.deps.ch.qos.logback.classic.Logger.error(Logger.java:534)
        at com.taobao.arthas.core.advisor.SpyImpl.atExceptionExit(SpyImpl.java:93)
        at java.arthas.SpyAPI.atExceptionExit(SpyAPI.java:69)

回答

4

看到有个相关的issue https://github.com/alibaba/arthas/issues/2439 我当时的case是attach成功,watch后报错退出了,然后服务日志中处出现请求watch方法的时候报错上面的NoClassDefFoundError

5

大概率一样的OOM问题,仔细看日志。