9 Replies Latest reply on Dec 24, 2002 3:20 AM by Greg McCreath

    RMIAdapterService vs Eclipse

    Greg McCreath Newbie

      Hi all,

      When starting JBoss 3.0.4 within the eclipse workbench, the loading of the RMIAdapterService for JMX fails. It cannot find the RMIAdapter interface. It (of course) starts fine outside of eclipse.

      All other services/MBeans starts fine within eclipse, just this one MBean fails and I can't see any reason for it to. The RMIAdapterService is in exactly the same package and it is loaded correctly.

      I've tried is as a sar and as an expended directory with no luck.

      All help appreciated.

      Greg.

        • 1. Re: RMIAdapterService vs Eclipse
          Adrian Brock Master

          What does "fails" mean?

          Regards,
          Adrian

          • 2. Re: RMIAdapterService vs Eclipse
            Greg McCreath Newbie

            "Fail" means it cannot load the RMIAdapter class. I get a NoClassDefFoundError. It *does* load the RMIAdapterService though (which is in the same package), so I'm guessing they are being loaded by different loaders.

            • 3. Re: RMIAdapterService vs Eclipse
              Adrian Brock Master

              Both classes are in jmx-rmi-adaptor.sar

              The implementation RMIAdaptorImpl.class is in jboss.jar

              Regards,
              Adrian

              • 4. Re: RMIAdapterService vs Eclipse
                Greg McCreath Newbie

                Oops! Been a while. Sorry. 'Fails' means I get a ava.lang.NoClassDefFoundError: org/jboss/jmx/adaptor/rmi/RMIAdaptor

                when eclipse tries to load JBoss. It loads the service (which is in the same package/sar).

                I have tried changing the main thread used by JBoss to the use the context class loader of a core eclipse plugin but no cigar.

                • 5. Re: RMIAdapterService vs Eclipse
                  Greg McCreath Newbie

                  Hi Adrian,

                  The problem seems to be with loading the RMIAdaptor interface, and not its RMIAdaptorImpl implementation.

                  Nested Throwable is:

                  (java.lang.NoClassDefFoundError: org/jboss/jmx/adaptor/rmi/RMIAdaptor)

                  The service and the RMIAdaptor are in the same sar and therefore should be using the same UCL.

                  The other default jboss services load with no problems and I just can't seem to isolate why this sar causes a problem in Eclipse. I have changed the context classloader of the worker thread in (a subclass of) org.jboss.Main to use the classloader used by eclipse to load my app. Makes no difference.

                  All help appreciated.

                  Greg.

                  • 6. Re: RMIAdapterService vs Eclipse
                    Adrian Brock Master

                    Can you post the stack trace?

                    I suspect this has something to do with the RMI stub.

                    Regards,
                    Adrian

                    • 7. Re: RMIAdapterService vs Eclipse
                      Greg McCreath Newbie

                      Adrian,

                      Thanks. Here is the trace when running inside of Eclipse.

                      09:15:42,105 ERROR [URLDeploymentScanner] Failed to deploy: org.jboss.deployment.scanner.URLDeploymentScanner$DeployedURL@3b857241{ url=file:/C:/Projects/tafmohost/deploy/server/default/deploy/jmx-rmi-adaptor.sar, deployedLastModified=0 }
                      org.jboss.deployment.DeploymentException: Could not create deployment: file:/C:/Projects/tafmohost/deploy/server/default/deploy/jmx-rmi-adaptor.sar; - nested throwable: (java.lang.NoClassDefFoundError: org/jboss/jmx/adaptor/rmi/RMIAdaptor)
                      at org.jboss.deployment.MainDeployer.start(MainDeployer.java:827)
                      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:621)
                      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:585)
                      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                      at java.lang.reflect.Method.invoke(Method.java:324)
                      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
                      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517)
                      at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174)
                      at $Proxy4.deploy(Unknown Source)
                      at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:435)
                      at org.jboss.deployment.scanner.URLDeploymentScanner.scanDirectory(URLDeploymentScanner.java:656)
                      at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:507)
                      at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:261)
                      at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:165)
                      at sun.reflect.GeneratedMethodAccessor7.invoke(Unknown Source)
                      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                      at java.lang.reflect.Method.invoke(Method.java:324)
                      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
                      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517)
                      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
                      at $Proxy0.start(Unknown Source)
                      at org.jboss.system.ServiceController.start(ServiceController.java:398)
                      at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
                      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                      at java.lang.reflect.Method.invoke(Method.java:324)
                      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
                      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517)
                      at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174)
                      at $Proxy3.start(Unknown Source)
                      at org.jboss.deployment.SARDeployer.start(SARDeployer.java:249)
                      at org.jboss.deployment.MainDeployer.start(MainDeployer.java:807)
                      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:621)
                      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:585)
                      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:569)
                      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                      at java.lang.reflect.Method.invoke(Method.java:324)
                      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
                      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517)
                      at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:324)
                      at org.jboss.system.server.ServerImpl.start(ServerImpl.java:221)
                      at org.jboss.Main.boot(Main.java:148)
                      at be.intellect.tafmo.kernel.TafmoHost$1.run(TafmoHost.java:67)
                      at java.lang.Thread.run(Thread.java:536)

                      Greg.

                      • 8. Re: RMIAdapterService vs Eclipse
                        Adrian Brock Master

                        Ok, there's not a lot of information there,
                        but it does look like a problem binding
                        the rmi stub, because it cannot find the interface.

                        Do you have any of the classes in your classpath
                        such as RMIAdaptorImpl_Stub.class?

                        If you boot jboss normally, there is only the
                        jdk and a few boot classes in the classpath.

                        Regards,
                        Adrian

                        • 9. Re: RMIAdapterService vs Eclipse
                          Greg McCreath Newbie

                          Thanks Adrian,

                          There are no packages on the classpath (OS or configured for jboss in run.bat) that have that RMI impl class in it. It all seems pretty straight forward. The run.bat JBOSS_CLASSPATH has a few additions to it, but nothing to do with jboss or jmx specifically.

                          Is the RMIAdapter doing anything particularly unique within JBoss?