[alibaba/arthas]logger 命令在jdk17的环境下无响应

2024-07-17 335 views
7
环境信息
  • arthas-boot.jar 或者 as.sh 的版本:3.6.7
  • Arthas 版本: 3.6.7
  • 操作系统版本: Ubuntu 22.04
  • 目标进程的JVM版本: opendjk17
  • 执行arthas-boot的版本: 3.6.7
重现问题的步骤
  1. 在控制执行logger命令没有没有响应
期望的结果

有日志信息返回

实际运行的结果

image

2023-09-14 08:57:02 [arthas-command-execute] ERROR c.t.a.c.command.logger.LoggerCommand -arthas loggger command try to define helper class error: com.taobao.arthas.core.command.logger.LogbackHelper2a869a16366d8b97
java.lang.NullPointerException: Cannot invoke "Object.getClass()" because "cause" is null
    at com.taobao.arthas.common.ReflectException.<init>(ReflectException.java:9)
    at com.taobao.arthas.common.ReflectUtils.defineClass(ReflectUtils.java:493)
    at com.taobao.arthas.common.ReflectUtils.defineClass(ReflectUtils.java:418)
    at com.taobao.arthas.core.command.logger.LoggerCommand.helperClassNameWithClassLoader(LoggerCommand.java:301)
    at com.taobao.arthas.core.command.logger.LoggerCommand.loggerInfo(LoggerCommand.java:315)
    at com.taobao.arthas.core.command.logger.LoggerCommand.loggers(LoggerCommand.java:237)
    at com.taobao.arthas.core.command.logger.LoggerCommand.process(LoggerCommand.java:144)
    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.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
    at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
    at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.base/java.lang.Thread.run(Unknown Source)

回答

6

@hengyunabc 请问有什么临时解决办法吗? 我看你的意思是4.0.0修复这个问题吗?

8

暂时没有发版本计划,可以自己本地打包下。 或者让应用在启动时增加 jvm 参数,增加 open export 之类的。比如 --add-opens java.base/java.util=ALL-UNNAMED (不一定准确)