laghdaf / jvmtop

Automatically exported from code.google.com/p/jvmtop
0 stars 0 forks source link

com.ibm.tools.attach.AttachNotSupportedException: target not found #2

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Environment is Linux machine running IBM WebSphere8 64-bit.
2. Execute jvmtop against java pid.

What is the expected output? What do you see instead?

==> I get the following error ::

com.ibm.tools.attach.AttachNotSupportedException: target not found
        at com.ibm.tools.attach.javaSE.VirtualMachineImpl.attachTarget(VirtualMachineImpl.java:81)
        at com.ibm.tools.attach.javaSE.AttachProviderImpl.attachVirtualMachine(AttachProviderImpl.java:37)
        at ibm.tools.attach.J9AttachProvider.attachVirtualMachine(J9AttachProvider.java:60)
        at com.sun.tools.attach.VirtualMachine.attach(VirtualMachine.java:221)
        at com.jvmtop.openjdk.tools.LocalVirtualMachine.getLocalVirtualMachine(LocalVirtualMachine.java:277)
        at com.jvmtop.VMDetailView.<init>(VMDetailView.java:23)
        at com.jvmtop.JvmTop.main(JvmTop.java:36)
com.ibm.tools.attach.AttachNotSupportedException: target not found
        at com.ibm.tools.attach.javaSE.VirtualMachineImpl.attachTarget(VirtualMachineImpl.java:81)
        at com.ibm.tools.attach.javaSE.AttachProviderImpl.attachVirtualMachine(AttachProviderImpl.java:37)
        at ibm.tools.attach.J9AttachProvider.attachVirtualMachine(J9AttachProvider.java:60)
        at com.sun.tools.attach.VirtualMachine.attach(VirtualMachine.java:221)
        at com.jvmtop.VMInfo.processNewVM(VMInfo.java:134)
        at com.jvmtop.VMDetailView.<init>(VMDetailView.java:24)
        at com.jvmtop.JvmTop.main(JvmTop.java:36)
Error while attaching vm 13315
com.sun.tools.attach.AttachNotSupportedException: target not found
        at ibm.tools.attach.J9AttachProvider.attachVirtualMachine(J9AttachProvider.java:65)
        at com.sun.tools.attach.VirtualMachine.attach(VirtualMachine.java:221)
        at com.jvmtop.VMInfo.processNewVM(VMInfo.java:134)
        at com.jvmtop.VMDetailView.<init>(VMDetailView.java:24)
        at com.jvmtop.JvmTop.main(JvmTop.java:36)
Exception in thread "main" java.lang.NullPointerException
        at com.jvmtop.VMInfo.processNewVM(VMInfo.java:147)
        at com.jvmtop.VMDetailView.<init>(VMDetailView.java:24)
        at com.jvmtop.JvmTop.main(JvmTop.java:36)

What version of the product are you using? On what operating system?

==> jvmtop 0.3 on Linux / CentOS 64-bit

Please provide any additional information below.

==> IBM JDK used to run WebSphere & execute jvmtop is the same :

java version "1.6.0"
Java(TM) SE Runtime Environment (build pxa6460_26sr1fp1-20120309_01(SR1 FP1))
IBM J9 VM (build 2.6, JRE 1.6.0 Linux amd64-64 20120308_104898 (JIT enabled, 
AOT enabled)
J9VM - R26_Java626_SR1_FP1_20120308_1511_B104898
JIT  - r11_20111028_21230ifx5
GC   - R26_Java626_SR1_FP1_20120308_1511_B104898
J9CL - 20120308_104898)
JCL  - 20120214_01

Original issue reported on code.google.com by stev...@gmail.com on 4 Apr 2013 at 4:45

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Beside compatibility issues with IBM JDK on Linux (see issue #1) - do you have 
the privileges to monitor the specified pid?

Did you execute jvmtop with the same user as the owner of the PID or do you 
have the permissions specified by RMI security settings of the to-be-monitored 
process?

Original comment by patric.r...@gmail.com on 4 Apr 2013 at 7:54

GoogleCodeExporter commented 9 years ago
Hi,

I am running the java process as root and using root to execute jvmtop... There 
might be some extra RMI security stuff in WebSphere 8 - I will check. This 
(http://code.google.com/p/jvmtop/issues/detail?id=1) issue might still prevent 
me from running it - but I will check anyway...

Thanks,
Steve.

Original comment by stev...@gmail.com on 5 Apr 2013 at 8:44

GoogleCodeExporter commented 9 years ago
Getting the same exception on Amazon Linux AMI : 3.2.39-6.88.amzn1.x86_64

java version "1.6.0_24"
OpenJDK Runtime Environment (IcedTea6 1.11.11) 
(amazon-61.1.11.11.53.amzn1-x86_64)
OpenJDK 64-Bit Server VM (build 20.0-b12, mixed mode)

Original comment by VichMar...@gmail.com on 15 May 2013 at 1:07

GoogleCodeExporter commented 9 years ago
Here's what worked for me:

com.sun.tools.attach.AttachNotSupportedException: no providers installed

"My diagnosis of this problem is that I was executing java on the command line, 
which as a result of my JDK and JRE installation choices was pointing to the 
java.exe in the %JAVA_HOME%/jre/bin directory. While this is technically the 
same executable, you will find that when using the instrumentation packages, 
the java executable expects to find tools.jar using a relative path, and that 
path is relative to the java.exe in the %JAVA_HOME%/bin directory. So ensure at 
launch time that you are running the java executable in the JDK bin, not the 
JRE bin, directory."

Source: 
http://wayne-adams.blogspot.ca/2009/07/instrumenting-running-java-processes.html

Original comment by nikit...@gmail.com on 23 May 2013 at 3:56

GoogleCodeExporter commented 9 years ago
Question to the creator of this issue, @stevedb:

Does version 0.5.1 fix this problem?

Original comment by patric.r...@gmail.com on 31 May 2013 at 10:20

GoogleCodeExporter commented 9 years ago
Hi,

I need to test this - I will hopefully get to this next week...

Original comment by stev...@gmail.com on 31 May 2013 at 12:22

GoogleCodeExporter commented 9 years ago
@stevedb: any news on this?

Original comment by patric.r...@gmail.com on 11 Jun 2013 at 6:41

GoogleCodeExporter commented 9 years ago
Hi,

I tested this again with 0.5.1 and 0.6.0 with no luck. 2 different exceptions 
though (both versions complain ==> java.io.IOException: Target not attached but 
0.6.0 has a java.lang.NullPointerException). I also manually called the correct 
java executable as per comments in this thread about not using JRE java 
executable.

0.5.1

/opt/IBM/WebSphere85/AppServer/java/bin/java -cp 
jvmtop.jar:/opt/IBM/WebSphere85/AppServer/java/lib/tools.jar com.jvmtop.JvmTop 
13786
java.io.IOException: Target not attached
        at com.ibm.tools.attach.javaSE.VirtualMachineImpl.getSystemProperties(VirtualMachineImpl.java:171)
        at ibm.tools.attach.J9VirtualMachine.getSystemProperties(J9VirtualMachine.java:51)
        at com.jvmtop.openjdk.tools.LocalVirtualMachine.loadManagementAgent(LocalVirtualMachine.java:346)
        at com.jvmtop.openjdk.tools.LocalVirtualMachine.startManagementAgent(LocalVirtualMachine.java:137)
        at com.jvmtop.openjdk.tools.ProxyClient.tryConnect(ProxyClient.java:367)
        at com.jvmtop.openjdk.tools.ProxyClient.connect(ProxyClient.java:349)
        at com.jvmtop.VMInfo.attachToVM(VMInfo.java:202)
        at com.jvmtop.VMInfo.processNewVM(VMInfo.java:158)
        at com.jvmtop.VMDetailView.<init>(VMDetailView.java:26)
        at com.jvmtop.JvmTop.main(JvmTop.java:35)
Exception in thread "main" java.lang.NullPointerException
        at com.jvmtop.VMDetailView.printView(VMDetailView.java:54)
        at com.jvmtop.JvmTop.run(JvmTop.java:70)
        at com.jvmtop.JvmTop.main(JvmTop.java:35)

0.6.0

/opt/IBM/WebSphere85/AppServer/java/bin/java -cp 
jvmtop.jar:/opt/IBM/WebSphere85/AppServer/java/lib/tools.jar com.jvmtop.JvmTop 
13786
java.io.IOException: Target not attached
        at com.ibm.tools.attach.javaSE.VirtualMachineImpl.getSystemProperties(VirtualMachineImpl.java:171)
        at ibm.tools.attach.J9VirtualMachine.getSystemProperties(J9VirtualMachine.java:51)
        at com.jvmtop.openjdk.tools.LocalVirtualMachine.loadManagementAgent(LocalVirtualMachine.java:346)
        at com.jvmtop.openjdk.tools.LocalVirtualMachine.startManagementAgent(LocalVirtualMachine.java:137)
        at com.jvmtop.openjdk.tools.ProxyClient.tryConnect(ProxyClient.java:367)
        at com.jvmtop.openjdk.tools.ProxyClient.connect(ProxyClient.java:349)
        at com.jvmtop.VMInfo.attachToVM(VMInfo.java:207)
        at com.jvmtop.VMInfo.processNewVM(VMInfo.java:163)
        at com.jvmtop.VMDetailView.<init>(VMDetailView.java:26)
        at com.jvmtop.JvmTop.main(JvmTop.java:35)
 JvmTop 0.6.0 alpha          amd64,  1 cpus, Linux 2.6.18-30
 http://code.google.com/p/jvmtop

ERROR: Could not attach to process.

Original comment by stev...@gmail.com on 13 Jun 2013 at 10:05

GoogleCodeExporter commented 9 years ago

Version of JAVA used this time around (slightly different to original version I 
used when I logged this ticket as we upgraded our WebSphere environment) :

/opt/IBM/WebSphere85/AppServer/java/bin/java -version
java version "1.6.0"
Java(TM) SE Runtime Environment (build 
pxa6460_26sr5ifix-20130301_01(SR5+IV36426))
IBM J9 VM (build 2.6, JRE 1.6.0 Linux amd64-64 Compressed References 
20130204_137148 (JIT enabled, AOT enabled)
J9VM - R26_Java626_SR5_20130204_0851_B137148
JIT  - r11.b03_20130131_32403
GC   - R26_Java626_SR5_20130204_0851_B137148_CMPRSS
J9CL - 20130204_137148)
JCL  - 20130204_01

Original comment by stev...@gmail.com on 13 Jun 2013 at 10:11

GoogleCodeExporter commented 9 years ago
Stevedb, thank you for your update.

I'll have a look at this, although I'm unsure if it's possible to attach this 
jvm at all (as mentioned above, most probably due to security-related reasons). 
Nevertheless, an exception should not occurr here.

For my tests, I am also using a fairly recent WebSphere 7 JDK on Linux (and 
this works perfectly), however I had not the chance yet to do this against a 
JDK included in WebSphere 8 - maybe this makes the difference.

Did you still ran jvmtop as root at the time the exceptions were thrown?
I am interessted if you can attach this process using jconsole?

Original comment by patric.r...@gmail.com on 13 Jun 2013 at 7:15

GoogleCodeExporter commented 9 years ago
I faced similar issue but got the resolution.
As, someone has mentioned here.
We need to run the jvmtop with same user which is running java.
In my case it was jboss user.
So, once you set the JAVA_HOME path to the JDK-used. Run jvmtop with same jboss 
user credential.

Original comment by srikant....@gmail.com on 4 Jul 2013 at 4:07

GoogleCodeExporter commented 9 years ago

Original comment by patric.r...@gmail.com on 18 Jul 2013 at 1:53

GoogleCodeExporter commented 9 years ago

I cannot get this working with the WebSphere app server I am using. It might be 
permissions, it might be something else. I am running everything as root but I 
still get the exceptions I note previously. I am happy to close this issue as 
not fixable if it's just too hard / not possible...

Original comment by stev...@gmail.com on 24 Jul 2013 at 11:50

GoogleCodeExporter commented 9 years ago
@stevedb:

There's something you can do in order to help me:
I am interessted if you can attach this process using jconsole?

(first asked in comment #11, that's why I changed this state to "NeedInfo)

Original comment by patric.r...@gmail.com on 26 Jul 2013 at 6:58

GoogleCodeExporter commented 9 years ago
@all : Please retest if jvmtop 0.8.0 is fixing the attaching issues.

Please let us know if the issues are fixed - or post what is not yet working.

Original comment by patric.r...@gmail.com on 14 Aug 2013 at 2:46

GoogleCodeExporter commented 9 years ago
Hi,

I just re-tested this and it is now working connecting to a IBM WebSphere 8.5 
Application Server using this version of Java. Note that when I connected to 
the server java process, I used the same java version to ensure all versions we 
the same because I know that there might be issues when using different server 
and client jdk versions.

===========================

$JAVA_HOME/bin/java -version
java version "1.6.0"
Java(TM) SE Runtime Environment (build 
pxa6460_26sr5ifix-20130301_01(SR5+IV36426))
IBM J9 VM (build 2.6, JRE 1.6.0 Linux amd64-64 Compressed References 
20130204_137148 (JIT enabled, AOT enabled)
J9VM - R26_Java626_SR5_20130204_0851_B137148
JIT  - r11.b03_20130131_32403
GC   - R26_Java626_SR5_20130204_0851_B137148_CMPRSS
J9CL - 20130204_137148)
JCL  - 20130204_01

==========================

JvmTop 0.8.0 alpha - 16:04:11,  amd64,  1 cpus, Linux 2.6.18-30, load avg 0.80
 http://code.google.com/p/jvmtop

 PID 1980: com.ibm.wsspi.bootstrap.WSPreLauncher
 ARGS: -nosplash -application com.ibm.ws.bootstrap.WSLauncher com.ibm.ws.r[...]
 VMARGS: -Xoptionsfile=/opt/IBM/WebSphere85/AppServer/java/jre/lib/amd64/c[...]
 VM: IBM Corporation IBM J9 VM 1.6.0
 UP: 48:51m  #THR: 166  #THRPEAK: 167  #THRCREATED: 8444 USER: root
 GC-Time:  0: 1m   #GC-Runs: 516       #TotalLoadedClasses: 31599
 CPU: 18.96% GC:  0.00% HEAP: 781m /2048m NONHEAP: 249m /  n/a

  TID   NAME                                    STATE    CPU  TOTALCPU BLOCKEDBY
  13130 RMI TCP Connection(4)-192.168.4       RUNNABLE 17.86%     0.04%
  13137 JMX server connection timeout   TIMED_WAITING  0.70%     0.00%
      4 JIT Compilation Thread-0             RUNNABLE  0.59%     0.36%
    131 Store org.hibernate.cache.Upda  TIMED_WAITING  0.04%     1.29%
    164 Store NormalizationCache Spool  TIMED_WAITING  0.04%     1.27%
    133 Store org.hibernate.cache.Stan  TIMED_WAITING  0.04%     1.21%
     27 Deferred Alarm Manager          TIMED_WAITING  0.03%     1.05%
     28 Non-Deferred Alarm Manager      TIMED_WAITING  0.02%     0.81%
    156 Scheduler                       TIMED_WAITING  0.02%     2.73%
    160 Scheduler                       TIMED_WAITING  0.02%     2.74%
 Note: Only top 10 threads (according cpu load) are shown!

==========================

Good job !!!

Original comment by stev...@gmail.com on 14 Aug 2013 at 3:16

GoogleCodeExporter commented 9 years ago
And using the --profile option works also...

Original comment by stev...@gmail.com on 14 Aug 2013 at 3:26

GoogleCodeExporter commented 9 years ago
Thanks @stevedb for retesting this so quickly!

@all:
If you're still having some problems with ibm jdk - just reopen a new issue.

Original comment by patric.r...@gmail.com on 15 Aug 2013 at 12:13