[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-serviceability-dev
Subject:    Re: RFR(XS): 8048050: Agent NullPointerException when rmi.port in use
From:       Sergey Gabdurakhmanov <sergey.gabdurakhmanov () oracle ! com>
Date:       2014-11-14 16:23:21
Message-ID: 8c93fff6-4bdd-4293-ba0d-f49649489ecf () default
[Download RAW message or body]

Hi Daniel,

Our documentation does not specify the exact exception that should be thrown in this \
scenario. But it should be reasonable. That makes testcase very difficult to \
implement. Because "reasonable" is not clear for test. E.g. "divided by zero" is not \
reasonable, but "illegal argument" is... I prefer do not put any tests where.

BR,
Sergey

----- Original Message -----
From: daniel.fuchs@oracle.com
To: jaroslav.bachorik@oracle.com, sergey.gabdurakhmanov@oracle.com, \
hotspot-runtime-dev@openjdk.java.net, dmitry.samersoff@oracle.com, \
                serviceability-dev@openjdk.java.net
Sent: Friday, November 14, 2014 4:32:38 PM (GMT+0300) Auto-Detected
Subject: Re: RFR(XS): 8048050: Agent NullPointerException when rmi.port in use

Hi Sergey,

The fix looks fine.
I wonder whether there should be a testcase for that?

best regards,

-- daniel

On 14/11/14 14:10, Jaroslav Bachorik wrote:
> 
> Good to go.
> 
> -JB-
> 
> On 11/14/2014 02:07 PM, Sergey Gabdurakhmanov wrote:
> > Hi,
> > 
> > Could I please have a review of this small fix.
> > 
> > webrev: http://cr.openjdk.java.net/~sgabdura/8048050/webrev.00/
> > bug: https://bugs.openjdk.java.net/browse/JDK-8048050
> > 
> > Problem description:
> > If the com.sun.management.jmxremote.rmi.port option is provided it will
> > give a NPE if already in use by a different JVM. Its expected to fail
> > but should provide an appropriate exception.
> > 
> > STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
> > Run two instances in different JVMs at same time with the following
> > options:
> > -Dcom.sun.management.jmxremote.port=2222
> > -Dcom.sun.management.jmxremote.rmi.port=2223
> > -Dcom.sun.management.jmxremote.authenticate=false
> > 
> > Root cause:
> > Then we trying to start JMXConnectorServer (see method exportMBeanServer
> > of class sun.management.jmxremote.ConnectorBootstrap on already used
> > port it cause IOException. Call of connServer.getAddress().toString() in
> > the exception handler cause NullPointerException because
> > connServer.getAddress() returns null.
> > 
> > Solution:
> > Provide url.toString() if connServer.getAddress() is null
> > 
> > I'm going to push this fix into JDK9, 8 and 7.
> > 
> > BR,
> > Sergey
> > 
> 


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic