-
Bug
-
Resolution: Fixed
-
P4
-
5.0
-
b05
-
x86
-
windows_xp
-
Verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2149785 | 6u4 | Luis-Miguel Alventosa | P4 | Resolved | Fixed | b01 |
FULL PRODUCT VERSION :
java version "1.5.0_07"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_07-b03)
Java HotSpot(TM) Client VM (build 1.5.0_07-b03, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
This bug is OS independend
EXTRA RELEVANT SYSTEM CONFIGURATION :
I am using mx4j as server with JSR-160 generic connector.
A DESCRIPTION OF THE PROBLEM :
If the jconsole catches an exception (ex) from invoking an MBean it does
ex = Utils.getActualException(ex)
This method checks if the type of the exception. E.g. if it is an MBeanException, it calls getTargetException on that exception. However in my case this is null.
Maybe this is a violation of the JMX spec but anyhows this happens in some cases with the latest mx4j using burlap or hessian as transport protocol.
One line later the jconsole performs a toString on "ex" causing a NullPointerException in my case. This NPE goes through the complete Thread and stalls the complete JConsole.
Please add a check if the "actual exception" is null and then use the original exception catched instead of null.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. start a JMX Server using mx4j together with hessian or burlap
2. connect with jconsole -J-Djava.endorsed.dirs=... service:jmx:hessian://...
3. invoke an operation that throws an MBean exception
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The jconsole should open a dialog displaying the exception message.
ACTUAL -
The JConsole dumps the strack-trace below (see Error Message) and the MBean tab panel (Attributes, Operations, Notifications, Info) keeps completely disabled no matter what MBean you select in the MBeans tree.
ERROR MESSAGES/STACK TRACES THAT OCCUR :
Exception in thread "Worker-MBeans-myhost:8080" java.lang.NullPointerException
at sun.tools.jconsole.inspector.XMBeanAttributes$AttributesListener$1.run(XMBeanAttributes.java:786)
at sun.tools.jconsole.Worker.run(Worker.java:37)
Exception in thread "Worker-MBeans-wep06132:8080" java.lang.NullPointerException
at sun.tools.jconsole.inspector.XMBeanAttributes$AttributesListener$1.run(XMBeanAttributes.java:786)
at sun.tools.jconsole.Worker.run(Worker.java:37)
REPRODUCIBILITY :
This bug can be reproduced always.
CUSTOMER SUBMITTED WORKAROUND :
If I use an Introspector in the mx4j Server and convert all Exceptions to e.g. RuntimeException with the orignal message, the exception is properly handled by jconsole.
java version "1.5.0_07"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_07-b03)
Java HotSpot(TM) Client VM (build 1.5.0_07-b03, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
This bug is OS independend
EXTRA RELEVANT SYSTEM CONFIGURATION :
I am using mx4j as server with JSR-160 generic connector.
A DESCRIPTION OF THE PROBLEM :
If the jconsole catches an exception (ex) from invoking an MBean it does
ex = Utils.getActualException(ex)
This method checks if the type of the exception. E.g. if it is an MBeanException, it calls getTargetException on that exception. However in my case this is null.
Maybe this is a violation of the JMX spec but anyhows this happens in some cases with the latest mx4j using burlap or hessian as transport protocol.
One line later the jconsole performs a toString on "ex" causing a NullPointerException in my case. This NPE goes through the complete Thread and stalls the complete JConsole.
Please add a check if the "actual exception" is null and then use the original exception catched instead of null.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. start a JMX Server using mx4j together with hessian or burlap
2. connect with jconsole -J-Djava.endorsed.dirs=... service:jmx:hessian://...
3. invoke an operation that throws an MBean exception
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The jconsole should open a dialog displaying the exception message.
ACTUAL -
The JConsole dumps the strack-trace below (see Error Message) and the MBean tab panel (Attributes, Operations, Notifications, Info) keeps completely disabled no matter what MBean you select in the MBeans tree.
ERROR MESSAGES/STACK TRACES THAT OCCUR :
Exception in thread "Worker-MBeans-myhost:8080" java.lang.NullPointerException
at sun.tools.jconsole.inspector.XMBeanAttributes$AttributesListener$1.run(XMBeanAttributes.java:786)
at sun.tools.jconsole.Worker.run(Worker.java:37)
Exception in thread "Worker-MBeans-wep06132:8080" java.lang.NullPointerException
at sun.tools.jconsole.inspector.XMBeanAttributes$AttributesListener$1.run(XMBeanAttributes.java:786)
at sun.tools.jconsole.Worker.run(Worker.java:37)
REPRODUCIBILITY :
This bug can be reproduced always.
CUSTOMER SUBMITTED WORKAROUND :
If I use an Introspector in the mx4j Server and convert all Exceptions to e.g. RuntimeException with the orignal message, the exception is properly handled by jconsole.
- backported by
-
JDK-2149785 MBeans tab: NPE when handling Exception
-
- Resolved
-