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

使用mc功能就是为了简化替换class耗时过程,现在mc命令总数报错,请官方及时修复一下。 #2854

Open
1 task
zhaozhangxiao opened this issue Jun 26, 2024 · 4 comments

Comments

@zhaozhangxiao
Copy link

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

环境信息

最新版3.7.2

  • arthas-boot.jar 或者 as.sh 的版本: 3.7.2
  • Arthas 版本: arthas-all-3.7.2
  • 操作系统版本: centos7.4
  • 目标进程的JVM版本: jdk1.8.0_251
  • 执行arthas-boot的版本: 3.7.2

重现问题的步骤

线上代码,不做修改直接编译就报错。其他版本也试了不行。
[arthas@1]$ jad --source-only com.suninfo.siem.service.impl.SyslogServiceImpl > /tmp/SyslogServiceImpl.java [arthas@1]$ mc -c 33909752 /tmp/SyslogServiceImpl.java -d /tmp Memory compiler error, exception message: Compilation Error message: incompatible types: invalid method reference method getControlAdderss in class com.suninfo.userasset.entity.siem.SiemLogSource cannot be applied to given types required: no arguments found: java.lang.Object reason: actual and formal argument lists differ in length , line: 116 , message: incompatible types: java.lang.String[] cannot be converted to com.suninfo.siem.entity.siem.IteViewAlarmEventInfo , line: 312 , message: for-each not applicable to expression type required: array or java.lang.Iterable found: com.suninfo.siem.entity.siem.IteViewAlarmEventInfo , line: 312 , message: cannot find symbol symbol: method split(java.lang.String) location: variable messageStr of type com.suninfo.siem.entity.siem.IteViewAlarmEventInfo , line: 313 , , please check $HOME/logs/arthas/arthas.log for more details.
89

期望的结果

线上紧急问题,一遍遍替换class文件太麻烦了,如果能mc准确编译,支持线上修改代码就完美了,能有和动态语言一样的解决办法。期待及时修复该问题。谢谢
What do you expected from the above steps?

实际运行的结果

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

![Uploading 89.png…]()

@WangJi92
Copy link
Contributor

动态替换clazz 不是修复线上问题的神器,有风险!!! 最好不这么使用、

  • 可以通过本地编译之后将clazz 上传到 服务器然后进行替换 手动的方式。
  • 也可以通过arthas 插件自动化 ,配合对象存储 进行脚本化替换,可以参考插件相关文档

image

@WangJi92
Copy link
Contributor

image

@zhaozhangxiao
Copy link
Author

zhaozhangxiao commented Jun 26, 2024

image

这个都试了不行。 官方这个备注看过。 总感觉这个mc功能问题太多。 场景: 客户线上环境 要实现功能联调,一遍遍替换class文件在线上。太麻烦了。所以看有什么更好的办法,实现动态修改。谢谢

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