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

Start arthas.core in debug mode failed with VirtualMachine ClassNotFoundException #203

Closed
1 task done
Hearen opened this issue Oct 10, 2018 · 1 comment
Closed
1 task done

Comments

@Hearen
Copy link
Contributor

Hearen commented Oct 10, 2018

  • I have searched the issues of this repository and believe that this is not a duplicate.

Environment

  • Arthas version: 3.0.4
  • Operating System version: 16.04.1-Ubuntu 2018 x86_64 x86_64 x86_64 GNU/Linux
  • Java version of target JVM: jdk1.8.0_144
  • Java version of JVM used to attach: jdk1.8.0_144

Steps to reproduce this issue

  1. Configure the program arguments in IntelliJ with: -target-ip 127.0.0.1 -telnet-port 3658 -http-port 8563 -pid 13328 -core ~/.arthas/lib/3.0.4/arthas/arthas-core.jar -agent ~/.arthas/lib/3.0.4/arthas/arthas-agent.jar
  2. Start com/taobao/arthas/core/Arthas.java in debug mode

Expected Result

start Arthas server and ready to monitor target process (13328).

Actual Result

Error as:

Connected to the target VM, address: '127.0.0.1:45671', transport: 'socket'
Disconnected from the target VM, address: '127.0.0.1:45671', transport: 'socket'
Start arthas failed, exception stack trace: 
java.lang.NoClassDefFoundError: com/sun/tools/attach/VirtualMachine
	at com.taobao.arthas.core.Arthas.attachAgent(Arthas.java:58)
	at com.taobao.arthas.core.Arthas.<init>(Arthas.java:25)
	at com.taobao.arthas.core.Arthas.main(Arthas.java:96)
Caused by: java.lang.ClassNotFoundException: com.sun.tools.attach.VirtualMachine
	at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	... 3 more

F.Y.I

  1. VirtualMachine lies here: ~/.m2/repository/org/powermock/powermock-module-javaagent/1.7.4/powermock-module-javaagent-1.7.4.jar!/com/sun/tools/attach/VirtualMachine.class
  2. tried mvn clean compile in **/arthas/core but still no luck there.

@ralf0131 @hengyunabc

@Hearen Hearen changed the title Start arthas.core in debug mode failed with ClassNotFoundException VirtualMachine Start arthas.core in debug mode failed with VirtualMachine ClassNotFoundException Oct 10, 2018
@hengyunabc
Copy link
Collaborator

#222

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants