harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kevin Zhou (JIRA)" <j...@apache.org>
Subject [jira] Created: (HARMONY-6197) [classlib][lang-management] java.lang.management.ManagementFactory.getPlatformMBeanServer() throws a java.lang.Error
Date Wed, 06 May 2009 07:20:30 GMT
[classlib][lang-management] java.lang.management.ManagementFactory.getPlatformMBeanServer()
throws a java.lang.Error
--------------------------------------------------------------------------------------------------------------------

                 Key: HARMONY-6197
                 URL: https://issues.apache.org/jira/browse/HARMONY-6197
             Project: Harmony
          Issue Type: Bug
          Components: Classlib
    Affects Versions: 5.0M9
            Reporter: Kevin Zhou
             Fix For: 5.0M10


Given a test case [1], RI passes it while HARMONY throws a java.lang.Error as follows:

java.lang.Error: java.lang.NullPointerException
	at mx4j.server.MBeanMetaData$Factory.create(MBeanMetaData.java:181)
	at mx4j.server.MX4JMBeanServer.createMBeanMetaData(MX4JMBeanServer.java:779)
	at mx4j.server.MX4JMBeanServer.registerMBeanImpl(MX4JMBeanServer.java:764)
	at mx4j.server.MX4JMBeanServer.access$000(MX4JMBeanServer.java:97)
	at mx4j.server.MX4JMBeanServer$3.run(MX4JMBeanServer.java:796)
	at java.security.AccessController.doPrivilegedImpl(AccessController.java:112)
	at java.security.AccessController.doPrivileged(AccessController.java:75)
	at mx4j.server.MX4JMBeanServer.privilegedRegisterMBean(MX4JMBeanServer.java:792)
	at mx4j.server.MX4JMBeanServer.<init>(MX4JMBeanServer.java:175)
	at mx4j.server.MX4JMBeanServerBuilder.newMBeanServer(MX4JMBeanServerBuilder.java:53)
	at javax.management.MBeanServerBuilder.newMBeanServer(MBeanServerBuilder.java:54)
	at javax.management.MBeanServerFactory.createMBeanServerImpl(MBeanServerFactory.java:207)
	at javax.management.MBeanServerFactory.createMBeanServer(MBeanServerFactory.java:44)
	at javax.management.MBeanServerFactory.createMBeanServer(MBeanServerFactory.java:39)
	at java.lang.management.ManagementFactory.getPlatformMBeanServer(ManagementFactory.java:299)

[1] Test Case: 
    public void test_ManagementFactory_getPlatformMBeanServer() {
        ClassLoader savecl = (ClassLoader) AccessController
                .doPrivileged(new PrivilegedAction<ClassLoader>() {
                    public ClassLoader run() {
                        return Thread.currentThread().getContextClassLoader();
                    }
                });
        try {
            MBeanServer mBeanServer = AccessController
                    .doPrivileged(new PrivilegedAction<MBeanServer>() {
                        public MBeanServer run() {
                            Thread.currentThread().setContextClassLoader(null);
                            return ManagementFactory.getPlatformMBeanServer();
                        }
                    });
            assertNotNull(mBeanServer);
        } finally {
            final ClassLoader tmpsavecl = savecl;
            AccessController.doPrivileged(new PrivilegedAction<Object>() {
                public Object run() {
                    Thread.currentThread().setContextClassLoader(tmpsavecl);
                    return null;
                }
            });
        }
    }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message