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

Improve the mechanism of the mc command to search for java packages and classes #661

Closed
hengyunabc opened this issue Apr 23, 2019 · 12 comments
Labels
enhancement New feature or request
Milestone

Comments

@hengyunabc
Copy link
Collaborator

  • support JPMS in JDK9/10/11
  • better way to search in specified ClassLoader
@hengyunabc hengyunabc added the enhancement New feature or request label Apr 23, 2019
@hengyunabc hengyunabc added this to the 3.1.1 milestone Apr 23, 2019
@hengyunabc
Copy link
Collaborator Author

hengyunabc commented Apr 23, 2019

Package to test:
arthas-3.1.1-SNAPSHOT-bin.zip

@hnlsping
Copy link

arthas-3.1.1-SNAPSHOT-bin.zip 使用这个版本启动报:
错误日志提示:Arthas server agent start...
Agent jar file does not exist: %2Froot%2F.arthas%2Flib%2F3.1.1%2Farthas%2Farthas-core.jar
image
这个路径可配吗?

@hengyunabc
Copy link
Collaborator Author

@hnlsping 你是什么环境的shell?操作系统是什么? 怎么执行的?

@hnlsping
Copy link

hnlsping commented Apr 30, 2019 via email

@hnlsping
Copy link

系统里面是存在两个版本的 3.1.0跟这个3.1.1 , 3.1.0正常运行没问题, 3.1.1才会出现这个问题

@hengyunabc
Copy link
Collaborator Author

@hnlsping 具体怎么执行的?解压之后,cd到目录里,再执行 java -jar arthas-boot.jar

@hnlsping
Copy link

先解压到 /root/.arthas/lib/3.1.1/arthas 目录
然后cd 到 /root/.arthas/lib/3.1.1/arthas 目录
执行 java -jar arthas-boot.jar

@hengyunabc
Copy link
Collaborator Author

@hnlsping 直接在 /tmp 目录解压呢? 解压到 ~/.arthas 目录可能判断有问题。

@hnlsping
Copy link

hnlsping commented Apr 30, 2019 via email

@hengyunabc
Copy link
Collaborator Author

@hnlsping 原来的进程可能要重启下。或者试下启动 arthas-demo来测试下。

@hengyunabc
Copy link
Collaborator Author

因为 arthas-agent.jar 它是被 AppClassLoader 加载的,它是agent的入口,之前attach过之后,它会一直被使用。即使用户使用新版本,重新attach,还是用的最开始的版本。

因为新版本修改了 AgentBootstrap 的逻辑,所以需要重启应用才能生效。

$ sc -d com.taobao.arthas.agent.AgentBootstrap
 class-info        com.taobao.arthas.agent.AgentBootstrap
 code-source       /Users/hengyunabc/.arthas/lib/3.1.0/arthas/arthas-agent.jar
 name              com.taobao.arthas.agent.AgentBootstrap
 isInterface       false
 isAnnotation      false
 isEnum            false
 isAnonymousClass  false
 isArray           false
 isLocalClass      false
 isMemberClass     false
 isPrimitive       false
 isSynthetic       false
 simple-name       AgentBootstrap
 modifier          public
 annotation
 interfaces
 super-class       +-java.lang.Object
 class-loader      +-sun.misc.Launcher$AppClassLoader@3d4eac69
                     +-sun.misc.Launcher$ExtClassLoader@1e8e3531
 classLoaderHash   3d4eac69

@hnlsping
Copy link

hnlsping commented Apr 30, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants