Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8048050

Agent NullPointerException when rmi.port in use

XMLWordPrintable

        FULL PRODUCT VERSION :
        Java(TM) SE Runtime Environment (build 1.7.0_51-b13)
        Java HotSpot(TM) 64-Bit Server VM (build 24.51-b03, mixed mode)


        ADDITIONAL OS VERSION INFORMATION :
        3.11.0-17-generic #31-Ubuntu SMP Mon Feb 3 21:52:43 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux


        A DESCRIPTION OF THE PROBLEM :
        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.

        REGRESSION. Last worked in version 1.0

        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


        EXPECTED VERSUS ACTUAL BEHAVIOR :
        EXPECTED -
        Error given port already in use like when jmxremote.port is:

        Error: Exception thrown by the agent : java.rmi.server.ExportException: Port already in use: 2223
        ACTUAL -
        Error: Exception thrown by the agent : java.lang.NullPointerException


        ERROR MESSAGES/STACK TRACES THAT OCCUR :
        Error: Exception thrown by the agent : java.lang.NullPointerException


        REPRODUCIBILITY :
        This bug can be reproduced always.

        ---------- BEGIN SOURCE ----------
        public class Test {
        public static void main(String[] args) throws Exception {
        Thread.sleep(100000);
        }
        }
        ---------- END SOURCE ----------

              vkempik Vladimir Kempik
              webbuggrp Webbug Group
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: