Issue Details (XML | Word | Printable)

Key: VISUALVM-128
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: thurka
Reporter: rombert
Votes: 3
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
VisualVM

NPE while getting information from remote JVM

Created: 02/May/08 12:29 AM   Updated: 05/Nov/08 03:35 AM   Resolved: 05/Nov/08 03:35 AM
Component/s: code
Affects Version/s: Beta 2
Fix Version/s: 1.1

Time Tracking:
Not Specified

File Attachments: 1. Text File messages.log.gz (5 kB) 02/May/08 12:47 AM - rombert

Image Attachments:

1. monitor-window.png
(20 kB)
Environment:

Operating System: All
Platform: All


Issuezilla Id: 128
Tags:
Participants: jsedlacek, lmalvent, rombert and thurka


 Description  « Hide

Happens in both Beta 2 and RC ( RC hides it in the status bar though ).

I am connecting from a local Linux x86 machine to a remote Linux x86_64 machine.

Error message is:

java.lang.NullPointerException
at com.sun.tools.visualvm.jvm.MonitoredDataImpl.<init>(MonitoredDataImpl.java:82)
at com.sun.tools.visualvm.jvm.JmxSupport$1$1.run(JmxSupport.java:279)
at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:561)
[catch] at
org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:986)

Available data:

PID, Host, JVM, Java Home, Heap dump on OOME, JVM arguments ( lower half tab ),
System properties, all data in the 'threads' tab

Unavailable data:

Main class, arguments, JVM flags ( upper half line ), any data in the 'monitor' tab.

Remote application is started with

com.sun.management.jmxremote=
com.sun.management.jmxremote.authenticate=false
com.sun.management.jmxremote.port=1540
com.sun.management.jmxremote.ssl=false

and the data is properly available using jconsole.



jsedlacek added a comment - 02/May/08 12:38 AM

Could you please attach VisualVM logfile?


rombert added a comment - 02/May/08 12:47 AM

Created an attachment (id=70)
Log file


jsedlacek added a comment - 02/May/08 02:11 AM

Based on the logfile it looks like the root cause is this exception:

INFO [com.sun.tools.visualvm.jvmstat.JvmstatModelProvider]: getMonitoredVm failed
java.rmi.NotBoundException: JStatRemoteHost
at sun.rmi.registry.RegistryImpl.lookup(RegistryImpl.java:106)
at sun.rmi.registry.RegistryImpl_Skel.dispatch(Unknown Source)
at sun.rmi.server.UnicastServerRef.oldDispatch(UnicastServerRef.java:386)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:250)
at sun.rmi.transport.Transport$1.run(Transport.java:159)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
at java.lang.Thread.run(Thread.java:619)
at
sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:255)
at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:233)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:359)
at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
at java.rmi.Naming.lookup(Naming.java:84)
at
sun.jvmstat.perfdata.monitor.protocol.rmi.MonitoredHostProvider.<init>(MonitoredHostProvider.java:68)
Caused: sun.jvmstat.monitor.MonitorException: RMI Server JStatRemoteHost not
available
at
sun.jvmstat.perfdata.monitor.protocol.rmi.MonitoredHostProvider.<init>(MonitoredHostProvider.java:100)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at sun.jvmstat.monitor.MonitoredHost.getMonitoredHost(MonitoredHost.java:196)
at sun.jvmstat.monitor.MonitoredHost.getMonitoredHost(MonitoredHost.java:125)
[catch] at
com.sun.tools.visualvm.jvmstat.JvmstatModelProvider.getMonitoredVm(JvmstatModelProvider.java:52)
at
com.sun.tools.visualvm.jvmstat.JvmstatModelProvider.createModelFor(JvmstatModelProvider.java:69)
at
com.sun.tools.visualvm.jvmstat.JvmstatModelProvider.createModelFor(JvmstatModelProvider.java:44)
at com.sun.tools.visualvm.core.model.ModelFactory.getModel(ModelFactory.java:96)
at
com.sun.tools.visualvm.tools.jvmstat.JvmstatModelFactory.getJvmstatFor(JvmstatModelFactory.java:50)
at
com.sun.tools.visualvm.jvm.JRockitJvmProvider.createModelFor(JRockitJvmProvider.java:46)
at
com.sun.tools.visualvm.jvm.JRockitJvmProvider.createModelFor(JRockitJvmProvider.java:42)
at com.sun.tools.visualvm.core.model.ModelFactory.getModel(ModelFactory.java:96)
at com.sun.tools.visualvm.application.jvm.JvmFactory.getJVMFor(JvmFactory.java:65)
at
com.sun.tools.visualvm.jmx.application.JmxApplicationProvider.addJmxApplication(JmxApplicationProvider.java:305)
at
com.sun.tools.visualvm.jmx.application.JmxApplicationProvider.createJmxApplication(JmxApplicationProvider.java:205)
at
com.sun.tools.visualvm.jmx.application.AddJMXConnectionAction$1.run(AddJMXConnectionAction.java:78)
at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:561)
at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:986)


rombert added a comment - 02/May/08 02:18 AM

That is correct, jstatd is not started. I wouldn't expect it to be, since I'm
using only JMX for monitoring.

As I see it there are 2 separate issues here:

a) How to handle a JMX-only connection if there is not jstatd process.
b) Extracting supplementary information from JMX

Fixing b) directly would also fix a).


lmalvent added a comment - 02/May/08 04:11 AM

It looks like the

java.rmi.NotBoundException: JStatRemoteHost

exception and the

java.lang.NullPointerException
at ...MonitoredDataImpl.<init>(MonitoredDataImpl.java:82)

are not related.

The first one appears because you are not running jstatd on port 1099. As the
exception message states an rmiregistry is running on 1099 but there isn't an
entry for the remote object JStatRemoteHost.

The second one looks like a problem when trying to get some information from the
memory pools.

Is this something you can reproduce all the time or it just happens from time to
time?


rombert added a comment - 02/May/08 04:16 AM

Happens all the time. Only tested the following JVMs:

a) java version "1.6.0"
Java(TM) SE Runtime Environment (build 1.6.0-b105)
Java HotSpot(TM) 64-Bit Server VM (build 1.6.0-b105, mixed mode)

b) java version "1.6.0_03"
Java(TM) SE Runtime Environment (build 1.6.0_03-b05)
Java HotSpot(TM) Client VM (build 1.6.0_03-b05, mixed mode, sharing)


rombert added a comment - 02/May/08 04:19 AM

Above where the remote JVMs.

Local JVM is

java version "1.6.0_05"
Java(TM) SE Runtime Environment (build 1.6.0_05-b13)
Java HotSpot(TM) Server VM (build 10.0-b19, mixed mode)


lmalvent added a comment - 02/May/08 05:08 AM

I haven't been able to reproduce it with:

VisualVM 1.0 RC running on:

Linux version 2.4.21-53.EL running on i386
1.6.0_05; Java HotSpot(TM) Client VM 10.0-b19; Sun Microsystems Inc.

Notepad running on:

JVM: Java HotSpot(TM) 64-Bit Server VM (1.6.0_03-b05, mixed mode)
Java Home: /usr/lang/JAVA/jdk1.6_03/linux-amd64/jre

FYI, using com.sun.management.jmxremote= is not required if
com.sun.management.jmxremote.port=<port> has been specified.

Also, explicit JMX connections do not show main class, arguments
as this info cannot be retrieved from the JVM JMX model (known
limitation).

I think the only thing that fails is the Monitor tab.


rombert added a comment - 02/May/08 05:49 AM

Created an attachment (id=71)
Monitor window with empty output


thurka added a comment - 05/Nov/08 03:25 AM

This happens when you do remote monitoring with JMX (no jstatd running) and monitored application is
started with -XX:+UseConcMarkSweepGC


thurka added a comment - 05/Nov/08 03:35 AM

Fixed in trunk.

Checking in MonitoredDataImpl.java;
/cvs/visualvm/visualvm/jvm/src/com/sun/tools/visualvm/jvm/MonitoredDataImpl.java,v <--
MonitoredDataImpl.java
new revision: 1.11; previous revision: 1.10
done
Checking in JmxSupport.java;
/cvs/visualvm/visualvm/jvm/src/com/sun/tools/visualvm/jvm/JmxSupport.java,v <--
JmxSupport.java
new revision: 1.26; previous revision: 1.25
done