Arthas: getstatic 可以获取到静态变量内容,但是ognl 却提示ClassNotFoundException

Created on 3 Jun 2019  ·  3Comments  ·  Source: alibaba/arthas

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

环境信息

  • arthas-boot.jar 或者 as.sh 的版本: 3.1.1
  • Arthas 版本: 3.1.1
  • 操作系统版本: Linux version 2.6.32-642.el6.x86_64
  • 目标进程的JVM版本: 1.8.0_45
  • 执行arthas-boot的版本: 3.1.1

重现问题的步骤

  1. getstatic demo.ServiceUrlMapping handlerMethodCache
    image
  2. ognl '@demo.ServiceUrlMapping@handlerMethodCache'
    image
  3. getstatic 可以获取到静态变量内容,但是ognl 却提示ClassNotFoundException

期望的结果

What do you expected from the above steps?

实际运行的结果

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

把异常信息贴到这里
question-answered

Most helpful comment

你可以尝试使用sc-d参数查看demo.ServiceUrlMappingclassLoaderHash。然后使用ognl-c 参数指定你静态类demo.ServiceUrlMappingclassLoaderHash,例如:

$ ognl -c 18b4aac2 '@demo.ServiceUrlMapping@handlerMethodCache'

All 3 comments

最好有可执行的demo,不然很难定位问题。

你可以尝试使用sc-d参数查看demo.ServiceUrlMappingclassLoaderHash。然后使用ognl-c 参数指定你静态类demo.ServiceUrlMappingclassLoaderHash,例如:

$ ognl -c 18b4aac2 '@demo.ServiceUrlMapping@handlerMethodCache'

thanks !this issue solved my problem!!

Was this page helpful?
0 / 5 - 0 ratings