-
Bug
-
Resolution: Duplicate
-
P2
-
None
-
1.0
-
None
-
generic
-
generic
There is no synchronization between the heartbeat thread started by ClientCommunicatorAdmin and the thread that creates it. Hence the "connector" field of RMIConnector (and probably GenericConnector, I haven't checked), though it has been assigned to before the ClientCommunicatorAdmin is created, may still be seen as null in the new thread. Hence the following bug report from ###@###.###:
"Hello. I am attempting to run the "Basic" RMI example from the latest EA
release of the Remote API. The client receives a NullPointerException when
making the call to JMXConnectorFactory.connect(). However, the code
completes and produces the expected output.
Environment:
- J2SDK 1.4.2, JMX RI 1.2, JMX Remote API 1.0 EA 2
- RedHat 9
Steps to recreate:
1. start the rmiregistry
2. start the Server
3. start the Client
4. stop the Server
5. stop the rmiregistry
6. Repeat steps 1 - 5
####BEGIN OUTPUT####
Initialize the environment map
Create an RMI connector client and connect it to the RMI connector server
Connecting....
java.lang.NullPointerException
at
javax.management.remote.rmi.RMIConnector.access$200(RMIConnector.java:101)
at
javax.management.remote.rmi.RMIConnector$RMIClientCommunicatorAdmin.checkCon
nection(RMIConnector.java:1268)
at
com.sun.jmx.remote.internal.ClientCommunicatorAdmin$Checker.run(ClientCommun
icatorAdmin.java:162)
at java.lang.Thread.run(Thread.java:534)
Get an MBeanServerConnection
Domains:
Domain[0] = JMImplementation
Domain[1] = JMXConnectors
Create SimpleStandard MBean...
MBean count = 3
State = initial state
State = changed state
Add notification listener...
Invoke reset() in SimpleStandard MBean...
Waiting for notification...
Received notification:
javax.management.AttributeChangeNotification[source=MBeans:name=SimpleStanda
rd]
Remove notification listener...
Unregister SimpleStandard MBean...
Close the connection to the server
Bye! Bye!
####END OUTPUT####
Note that I added the "Connecting..." print statement to Client.java in
order to isolate the method in which this is occurring. The interesting
aspect is that some sort of "priming" is occurring as subsequent executions
of the client code run without such exceptions being thrown, as long as the
rmiregistry and server remain running. Shutting them down and restarting
will cause the problem to happen again. I didn't see any errata included in
the download to this effect so I am curious if anyone else has seen this."
"Hello. I am attempting to run the "Basic" RMI example from the latest EA
release of the Remote API. The client receives a NullPointerException when
making the call to JMXConnectorFactory.connect(). However, the code
completes and produces the expected output.
Environment:
- J2SDK 1.4.2, JMX RI 1.2, JMX Remote API 1.0 EA 2
- RedHat 9
Steps to recreate:
1. start the rmiregistry
2. start the Server
3. start the Client
4. stop the Server
5. stop the rmiregistry
6. Repeat steps 1 - 5
####BEGIN OUTPUT####
Initialize the environment map
Create an RMI connector client and connect it to the RMI connector server
Connecting....
java.lang.NullPointerException
at
javax.management.remote.rmi.RMIConnector.access$200(RMIConnector.java:101)
at
javax.management.remote.rmi.RMIConnector$RMIClientCommunicatorAdmin.checkCon
nection(RMIConnector.java:1268)
at
com.sun.jmx.remote.internal.ClientCommunicatorAdmin$Checker.run(ClientCommun
icatorAdmin.java:162)
at java.lang.Thread.run(Thread.java:534)
Get an MBeanServerConnection
Domains:
Domain[0] = JMImplementation
Domain[1] = JMXConnectors
Create SimpleStandard MBean...
MBean count = 3
State = initial state
State = changed state
Add notification listener...
Invoke reset() in SimpleStandard MBean...
Waiting for notification...
Received notification:
javax.management.AttributeChangeNotification[source=MBeans:name=SimpleStanda
rd]
Remove notification listener...
Unregister SimpleStandard MBean...
Close the connection to the server
Bye! Bye!
####END OUTPUT####
Note that I added the "Connecting..." print statement to Client.java in
order to isolate the method in which this is occurring. The interesting
aspect is that some sort of "priming" is occurring as subsequent executions
of the client code run without such exceptions being thrown, as long as the
rmiregistry and server remain running. Shutting them down and restarting
will cause the problem to happen again. I didn't see any errata included in
the download to this effect so I am curious if anyone else has seen this."
- duplicates
-
JDK-4893477 got NullPointerException and the client heartbeat failed
-
- Closed
-