2 Replies Latest reply on Nov 2, 2005 12:17 PM by Scott Stark

    how to get JBossMX's RelationService

    gymdaues Newbie

      I realize this may be more of a ClassLoader question, but how can I get an instance of the JBossMX RelationService and not the Sun Ref Impl version?

      I am using JBoss 4.03 with Java 1.5.0-05. I get the following traceback when attempting to add a relationship via RelationService.

      2005-11-02 10:09:27,278 INFO [STDOUT] javax.management.relation.InvalidRoleValueException: Child has an MBean reference to an MBean not of the expected class of references for that role.
      2005-11-02 10:09:27,279 INFO [STDOUT] at javax.management.relation.RelationService.throwRoleProblemException(RelationService.java:3703)
      2005-11-02 10:09:27,279 INFO [STDOUT] at javax.management.relation.RelationService.addRelationInt(RelationService.java:3252)
      2005-11-02 10:09:27,279 INFO [STDOUT] at javax.management.relation.RelationService.addRelation(RelationService.java:779)
      2005-11-02 10:09:27,279 INFO [STDOUT] at com.tripos.af.management.ManageableResource.addChildResource(ManageableResource.java:157)
      <blah blah>

      I can see from the line numbers in the traceback that it has entered into the RI version of the class, not JBossMX's which is the one I really want of course.
      Regardless of whether I create RelationService by direct instantiation or by subclassing it, I get the RI version.

      I've tried something like this as well to no avail:

      MBeanServer server = MBeanServerLocator.locateJBoss();
      ClassLoader cl = server.getClassLoader(null);
      Class clazz = cl.loadClass("javax.management.relation.RelationService");

      I can't take the RI out of the JRE or override it via EndorsedLibraries.