arthas 抓不到懒加载吗?

问题描述

今天使用 arthas 监控线上问题时,遇到一种情况,无论如何也无法监控到该方法。报错如下:

[arthas@66764]$ watch xxxx.getSql '{params,returnObj,throwExp}'  -n 5  -x 3
il getSql '{params,returnObj,throwExp}'  -n 5  -x 3n.util.SqlUt
Affect(class count: 0 , method count: 0) cost in 21 ms, listenerId: 19
No class or method is affected, try:
1. Execute `sm CLASS_NAME METHOD_NAME` to make sure the method you are tracing actually exists (it might be in your parent class).
2. Execute `options unsafe true`, if you want to enhance the classes under the `java.*` package.
3. Execute `reset CLASS_NAME` and try again, your method body might be too large.
4. Match the constructor, use `<init>`, for example: `watch demo.MathGame <init>`
5. Check arthas log: C:\Users\Administrator\logs\arthas\arthas.log
6. Visit https://github.com/alibaba/arthas/issues/47 for more details.

明显是找不到该方法。

但是我调用了一次该方法,然后再次执行,就能抓到了

于是我怀疑是否是懒加载导致的该问题,这个类没被调用,没被载入。导致无法监控到。

先把问题记录于此,抽空验证下,或者有大神在评论区帮我解释下,不胜感激。

你可能感兴趣的:(arthas,java,懒加载)