jmx-dev 8060166: javax/management/MBeanInfo/NotificationInfoTest.java fails with modular image

Daniel Fuchs daniel.fuchs at oracle.com
Mon Oct 13 14:35:40 UTC 2014


On 13/10/14 16:19, Alan Bateman wrote:
> URL codeBase =
> ClassLoader.getSystemResource("javax/management/MBeanServer.class");

Interesting simplification. This looks good to me :-)

I was intrigued by the difference so I tried the following:

System.out.println(ClassLoader.getSystemResource(
      "javax/management/MBeanServer.class"));

System.out.println(javax.management.MBeanServer.class
       .getProtectionDomain().getCodeSource().getLocation());


the second line throws a NPE - which was most probably
the reason for trying to locate rt.jar from java.home in
the first place...

best regards,

-- daniel


More information about the jmx-dev mailing list