Error: Agent exception: java.lang.NullPointerException when starting a Java application

I am launching a Java application with the following command line arguments:

java -Dcom.sun.management.jmxremote.port=12312 \ -Dcom.sun.management.jmxremote.rmi.port=12313 \ -Dcom.sun.management.jmxremote.authenticate=false \ Main 

My program will exit immediately and I get the following error:

Error: Agent exception raised: java.lang.NullPointerException

I am using Java 8 update on Windows 7:

 java version "1.8.0_45" Java(TM) SE Runtime Environment (build 1.8.0_45-b14) Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode) 
+7
java
source share
2 answers

This error occurs if com.sun.management.jmxremote.rmi.port installed on a port that is already in use. Try setting the property to a free port or killing the process that is currently using the corresponding port.

The opening JDK has an error message here to improve on this error message. It is fixed in update version 8 for Java 8 and update 7 on Java 7.

+11
source share

I faced the same problem. After you killed the old process using the same JMX port, the problem was resolved and tomcat started correctly.

0
source share

All Articles