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

AnsiLog format NullPointerException #2410

Closed
1 task done
JoeCqupt opened this issue Jan 16, 2023 · 2 comments
Closed
1 task done

AnsiLog format NullPointerException #2410

JoeCqupt opened this issue Jan 16, 2023 · 2 comments

Comments

@JoeCqupt
Copy link
Contributor

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

环境信息

  • arthas-boot.jar 或者 as.sh 的版本: master分支
  • Arthas 版本: master分支
  • 操作系统版本: 操作系统无关
  • 目标进程的JVM版本: JVM无关
  • 执行arthas-boot的版本: master

重现问题的步骤

     AnsiLog.warn("Target VM JAVA_HOME is {}, arthas-boot JAVA_HOME is {}, try to set the same JAVA_HOME.",
               null, System.getProperty("java.home"));

期望的结果

What do you expected from the above steps?

日志输出

实际运行的结果

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

Exception in thread "main" java.lang.NullPointerException
	at com.taobao.arthas.common.AnsiLog.format(AnsiLog.java:281)
	at com.taobao.arthas.common.AnsiLog.warn(AnsiLog.java:244)
	at com.taobao.arthas.common.AnsiLog.main(AnsiLog.java:294)
@JoeCqupt
Copy link
Contributor Author

Caused by: java.lang.NullPointerException: null
        at com.taobao.arthas.common.AnsiLog.format(AnsiLog.java:281)
        at com.taobao.arthas.common.AnsiLog.warn(AnsiLog.java:244)
        at com.taobao.arthas.core.Arthas.attachAgent(Arthas.java:112)
        at com.taobao.arthas.core.Arthas.<init>(Arthas.java:27)
        ... 9 common frames omitted

我的环境里面获取不到 "java.home"的值(为null)。这里会导致NullPointerException;导致 arthas-agent无法被load
image

@JoeCqupt
Copy link
Contributor Author

参考:oracle/graal#1812

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

1 participant