Arthas

Arthas通用方法调用

1、获取classLoder的hash值

sc -d com.alibaba.dubbo.config.spring.extension.SpringExtensionFactory
class-info com.alibaba.dubbo.config.spring.extension.SpringExtensionFactory
code-source    /data/project/aladdin/second/dubbo-3.2.18-RELEASE.jar
name  com.alibaba.dubbo.config.spring.extension.SpringExtensionFactory
super-class    +-java.lang.Object
class-loader   +-com.xxx.aladdin.container.loader.AladdinClassLoader@ae13544
       +-sun.misc.Launcher$AppClassLoader@18b4aac2
       +-sun.misc.Launcher$ExtClassLoader@7bb52275
classLoaderHash  ae13544

2、获取对应实例数据

ognl -c ae13544 '#context=@com.alibaba.dubbo.config.spring.extension.SpringExtensionFactory@contexts.iterator.next, #context.getBean("dataSource").getPassword()'

3、可调用任务任意的方法

ognl -c ae13544 '#context=@com.alibaba.dubbo.config.spring.extension.SpringExtensionFactory@contexts.iterator.next, #obj=new com.xxx.ListGetReq(),#obj.kdtId=42163374,#obj.itemIds={1562453283},#context.getBean("serviceImpl").list(#obj)'

ognl复杂对象赋值可以参考上面。

文章目录
  1. Arthas通用方法调用