4 Replies Latest reply on May 21, 2002 10:00 AM by pdmleng

    MBean classpath

    pdmleng

      Hi Folks,

      Is there a way to set the classpath for a specific MBean (JBoss 2.4.4)?
      I run into trouble with an MBean that must access an EJB: i've put a jar with the ejb home and remote interfaces in the lib/ext directory so that my MBean can load them. This works fine for the MBean, but the EJB deployment raises a ClassDefNotFound exception - probably due to the fact that the home and remote interfaces can be found in two places: lib/ext/mymbean.jar and the ejb.jar (and which thus can be fixed my removing the home and remote interface from the ejb.jar, but it feels a bit silly (understatement) to have an ejb.jar that does not contain home and remote interface).

      So, i think a (the) proper solution would be to be able to set the classpath for the MBean in such a way that it does not affect the classpath for the ejb (which /lib/ext does). I searched all the docs (including the book) and forums, but couldn't find how to achieve this - except for defining my service as MLET, but as it depends on other jboss MBeans, it must be defined in jboss.jcml....).

      Any ideas?

      Regards,
      Pete

        • 1. Re: MBean classpath

          For 2.4 I think your analysis is correct.
          An MLet is an MBean so you could add the MLet to
          jboss.jcml

          Can you post the stack trace for the ClassNotFoundException?

          Regards,
          Adrian

          • 2. Re: MBean classpath
            pdmleng

            Hi Adrian,

            Thanks for your reply.

            > For 2.4 I think your analysis is correct.
            I'm glad to hear that ;-).
            Is it different for 3.0?

            > An MLet is an MBean so you could add the MLet to
            > jboss.jcml
            Yes, sure, but i couldn't find a way to pass classpath parameter with an tag in the jboss.jcml..... Did i miss something?


            > Can you post the stack trace for the
            > ClassNotFoundException?
            See below; 'DateTimeSchedule' is the ejb's remote interface.
            Thanks for your help,
            Regards,
            Pete


            [ERROR,ContainerFactory] Verify failure
            java.lang.NoClassDefFoundError: com/nedap/aeos/ac/domain/time/DateTimeSchedule
            at java.lang.Class.getMethods0(Native Method)
            at java.lang.Class.getMethods(Class.java:742)
            at org.jboss.verifier.strategy.AbstractVerifier.isRMIIDLRemoteInterface(AbstractVerifier.java:907)
            at org.jboss.verifier.strategy.AbstractVerifier.isRMIIIOPType(AbstractVerifier.java:875)
            at org.jboss.verifier.strategy.AbstractVerifier.hasLegalRMIIIOPReturnType(AbstractVerifier.java:157)
            at org.jboss.verifier.strategy.EJBVerifier11.verifyEntityHome(EJBVerifier11.java:775)
            at org.jboss.verifier.strategy.EJBVerifier11.checkEntity(EJBVerifier11.java:121)
            at org.jboss.verifier.BeanVerifier.verify(BeanVerifier.java:132)
            at org.jboss.ejb.ContainerFactory.deploy(ContainerFactory.java:465)
            at org.jboss.ejb.ContainerFactory.deploy(ContainerFactory.java:369)
            at org.jboss.ejb.ContainerFactory.deploy(ContainerFactory.java:306)
            at java.lang.reflect.Method.invoke(Native Method)
            at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1628)
            at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
            at org.jboss.deployment.J2eeDeployer.startModules(J2eeDeployer.java:487)
            at org.jboss.deployment.J2eeDeployer.startApplication(J2eeDeployer.java:459)
            at org.jboss.deployment.J2eeDeployer.deploy(J2eeDeployer.java:190)
            at java.lang.reflect.Method.invoke(Native Method)
            at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1628)
            at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
            at org.jboss.deployment.AutoDeployer.deploy(AutoDeployer.java:395)
            at org.jboss.deployment.AutoDeployer.run(AutoDeployer.java:233)
            at org.jboss.deployment.AutoDeployer.startService(AutoDeployer.java:371)
            at org.jboss.util.ServiceMBeanSupport.start(ServiceMBeanSupport.java:103)
            at java.lang.reflect.Method.invoke(Native Method)
            at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1628)
            at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
            at org.jboss.configuration.ConfigurationService$ServiceProxy.invoke(ConfigurationService.java:967)
            at $Proxy0.start(Unknown Source)
            at org.jboss.util.ServiceControl.start(ServiceControl.java:79)
            at java.lang.reflect.Method.invoke(Native Method)
            at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1628)
            at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
            at org.jboss.Main.(Main.java:208)
            at org.jboss.Main$1.run(Main.java:110)
            at java.security.AccessController.doPrivileged(Native Method)
            at org.jboss.Main.main(Main.java:106)

            • 3. Re: MBean classpath

              Yes,

              In 3.0, the MBean can see the EJB classes.
              Both can be hotdeployed, although you'll need to
              specify a dependency to make sure the EJB is loaded
              before the MBean.

              The classloading problem is caused because the home
              interface returns a class from the ejb's jar
              which isn't visible to home's classloader.

              Regards,
              Adrian

              • 4. Re: MBean classpath
                pdmleng

                Ok, thanks Adrian.

                From your mail i conclude that in 2.4.4 there is no solution, except for the (bit silly) workaround i descriped in my first post. Apparently, there is no way to set the classpath specifically for an mbean, for example by passing a specific attribute value with the tag in the jboss.jcml

                Again, thanks for your help,
                Regards,
                Pete.