[ mx4j-Bugs-1021305 ] NoSuchMethodError - class file inconsistency

"SourceForge.net" <[email protected]>
Newsgroups gmane.comp.java.mx4j.devel
Message-ID <[email protected]>
Bugs item #1021305, was opened at 2004-09-02 18:46
Message generated for change (Comment added) made by biorn_steedom
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=450647&aid=1021305&group_id=47745

Category: JMX implementation
Group: Release 2.0.1
>Status: Closed
Resolution: Invalid
Priority: 5
Submitted By: Archie Cobbs (archiecobbs)
Assigned to: Simone Bordet (biorn_steedom)
Summary: NoSuchMethodError - class file inconsistency

Initial Comment:
Trying to use MX4J on JDK 1.4.2 and getting this exception:

     [java] Exception in thread "main"
java.lang.NoSuchMethodError:
javax.management.ObjectName.getInstance(Ljavax/management/ObjectName;)Ljavax/management/ObjectName;
     [java]     at
mx4j.server.MX4JMBeanServer.secureObjectName(MX4JMBeanServer.java:1478)
     [java]     at
mx4j.server.MX4JMBeanServer.registerMBeanImpl(MX4JMBeanServer.java:743)
     [java]     at
mx4j.server.MX4JMBeanServer.access$000(MX4JMBeanServer.java:100)
     [java]     at
mx4j.server.MX4JMBeanServer$3.run(MX4JMBeanServer.java:772)
     [java]     at
java.security.AccessController.doPrivileged(Native Method)
     [java]     at
mx4j.server.MX4JMBeanServer.privilegedRegisterMBean(MX4JMBeanServer.java:768)
     [java]     at
mx4j.server.MX4JMBeanServer.<init>(MX4JMBeanServer.java:176)
     [java]     at
mx4j.server.MX4JMBeanServerBuilder.newMBeanServer(MX4JMBeanServerBuilder.java:53)
     [java]     at
javax.management.MBeanServerFactory.createMBeanServer(MBeanServerFactory.java:183)
     [java]     at
javax.management.MBeanServerFactory.createMBeanServer(MBeanServerFactory.java:118)
     [java]     at
javax.management.MBeanServerFactory.createMBeanServer(MBeanServerFactory.java:112)
     [java]     at
com.awarix.trak.client.Main.main(Main.java:74)



My test code looks like this:

        // Use MX4J
       
System.setProperty("javax.management.builder.initial",
          "mx4j.server.MX4JMBeanServerBuilder");
 
        // Create MBean server
        MBeanServer mbeanServer =
MBeanServerFactory.createMBeanServer();
 

If I remove the System.setProperty() call it works. This
seems backwards from what the documentation says,
or else I'm confused.




----------------------------------------------------------------------

>Comment By: Simone Bordet (biorn_steedom)
Date: 2004-09-03 16:15

Message:
Logged In: YES 
user_id=128193

Look, from the stack trace above, MBeanServerFactory at
lines 112,118 is inside createMBeanServer().
The MX4J code, at those lines, is inside findMBeanServer().

The output of javap just shows that MX4J *does* contain the
missing method: it's the first of the list.

It's a problem in your classpath, if I did not say it already.

----------------------------------------------------------------------

Comment By: Archie Cobbs (archiecobbs)
Date: 2004-09-03 15:41

Message:
Logged In: YES 
user_id=99943

I believe you are mistaken. The only JMX classes in my classpath
are from MX4J 2.0.1. ObjectName.class is loaded from mx4j.jar.
But the ObjectName.class contained in mx4j.jar does not
contain the missing method:
 
    $ javap -classpath mx4j.jar javax/management/ObjectName
|grep getInstance
        public static javax.management.ObjectName
getInstance(javax.management.O
bjectName);
        public static javax.management.ObjectName
getInstance(java.lang.String);
        public static javax.management.ObjectName
getInstance(java.lang.String,j
ava.util.Hashtable);
        public static javax.management.ObjectName
getInstance(java.lang.String,j
ava.lang.String,java.lang.String);
    $ md5 mx4j.jar
    MD5(mx4j.jar)= a983db8056e89db79a478d6a33f02d38



----------------------------------------------------------------------

Comment By: Simone Bordet (biorn_steedom)
Date: 2004-09-03 10:56

Message:
Logged In: YES 
user_id=128193

You have in the classpath a JMX 1.1 version of the Reference
Implementation, which is not compatible with MX4J 2.0.1
since they implement a different version of the
specification (1.2), that added the missing method.
I'm closing this bug as invalid, since it's only a problem
in your classpath.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=450647&aid=1021305&group_id=47745


-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.