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

vmtool调用方法时如果多个参数问题 #2843

Open
1 task
lzz145 opened this issue May 30, 2024 · 1 comment
Open
1 task

vmtool调用方法时如果多个参数问题 #2843

lzz145 opened this issue May 30, 2024 · 1 comment

Comments

@lzz145
Copy link

lzz145 commented May 30, 2024

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

vmtool调用方法时如果需要传多个对象参数,且对象只有无参构造,怎么写命令?
例子:
@lombok.Data
public class Data {

private String name;
private String age;

}

public void doSomething2(Data d1, Data d2) {
。。。。。
}

@WangJi92
Copy link
Contributor

WangJi92 commented May 30, 2024

use arthas idea plugin 2.46 ,参考下面的issue

WangJi92/arthas-idea-plugin#127

通过 json 序列化,不过这个过程 插件帮你搞定了构造的过程修改一下参数就行了,非常easy

vmtool -x 3 --action getInstances --className com.wangji92.arthas.plugin.demo.controller.CommonController  --express 'instances[0].testParam(@com.alibaba.fastjson.JSON@parseObject("{\"name\":\" \",\"age\":0}",@com.wangji92.arthas.plugin.demo.controller.User@class),@com.alibaba.fastjson.JSON@parseObject("{\"name\":\" \",\"age\":0}",@com.wangji92.arthas.plugin.demo.controller.User@class))'  -c 197a18de

`

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

2 participants