8 Replies Latest reply on Apr 6, 2009 11:40 AM by David Ward

    JConsole doesn't work anymore

    David Lloyd Master

      With 5.0.0.CR2, I followed the wiki instructions to allow JConsole to connect by adding "-Djboss.platform.mbeanserver -Dcom.sun.management.jmxremote -Djavax.management.builder.initial=org.jboss.system.server.jmx.MBeanServerBuilderImpl" to JAVA_OPTS in run.conf.

      However startup instantly fails:

      Exception thrown by the agent : javax.management.JMRuntimeException: Failed to load MBeanServerBuilder class org.jboss.system.server.jmx.MBeanServerBuilderImpl: java.lang.ClassNotFoundException: org.jboss.system.server.jmx.MBeanServerBuilderImpl

      Any ideas? Is this a regression of JBAS-3947?

        • 1. Re: JConsole doesn't work anymore
          jaikiran pai Master

          In earlier versions of JBoss (ex: 4.2.3 GA), the run.jar file in %JBOSS_HOME%/bin contained this org.jboss.system.server.jmx.* package/classes. However in the current version (JBoss-5 CR2), i don't see any such org.jboss.system.server.jmx.* classes in that run.jar. So at the first step of booting, the server throws:

          ===============================================================================
          
           JBoss Bootstrap Environment
          
           JBOSS_HOME: D:\jboss-5.0.0.CR2
          
           JAVA: C:\jdk1.5.0_10\bin\java
          
           JAVA_OPTS: -Dprogram.name=run.bat -server -Xms128m -Xmx512m -XX:MaxPermSize=256m -Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Djboss.platform.mbeanserver -Dcom.sun.management.jmxremote -Djavax.management.builder.initial=org.jboss.system.server.jmx.MBeanServerBuilderImpl
          
           CLASSPATH: D:\jboss-5.0.0.CR2\bin\run.jar
          
          ===============================================================================
          
          javax.management.JMRuntimeException: Failed to load MBeanServerBuilder class org.jboss.system.server.jmx.MBeanServerBuilderImpl: java.lang.ClassNotFoundException: org.jboss.system.server.jmx.MBeanServerBuilderImpl
           at javax.management.MBeanServerFactory.checkMBeanServerBuilder(MBeanServerFactory.java:499)
           at javax.management.MBeanServerFactory.getNewMBeanServerBuilder(MBeanServerFactory.java:530)
           at javax.management.MBeanServerFactory.newMBeanServer(MBeanServerFactory.java:304)
           at javax.management.MBeanServerFactory.createMBeanServer(MBeanServerFactory.java:219)
           at javax.management.MBeanServerFactory.createMBeanServer(MBeanServerFactory.java:180)
           at sun.management.ManagementFactory.createPlatformMBeanServer(ManagementFactory.java:264)
           at java.lang.management.ManagementFactory.getPlatformMBeanServer(ManagementFactory.java:512)
           at sun.management.jmxremote.ConnectorBootstrap.startLocalConnectorServer(ConnectorBootstrap.java:385)
           at sun.management.Agent.premain(Agent.java:92)
           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:585)
           at sun.management.Agent.startAgent(Agent.java:197)
          Caused by: java.lang.ClassNotFoundException: org.jboss.system.server.jmx.MBeanServerBuilderImpl
           at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
           at java.security.AccessController.doPrivileged(Native Method)
           at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
           at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
           at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
           at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
           at javax.management.MBeanServerFactory.loadBuilderClass(MBeanServerFactory.java:441)
           at javax.management.MBeanServerFactory.checkMBeanServerBuilder(MBeanServerFactory.java:484)
           ... 13 more
          Exception thrown by the agent : javax.management.JMRuntimeException: Failed to load MBeanServerBuilder class org.jboss.system.server.jmx.MBeanServerBuilderImpl: java.lang.ClassNotFoundException: org.jboss.system.server.jmx.MBeanServerBuilderImplPress any key to continue . . .
          
          


          Not sure if these classes were intentionally moved out of the run.jar.

          P.S: The %JBOSS_HOME%/lib/jboss-system-jmx.jar does contain these classes but the exception occurs too early for this jar to come into picture.

          • 2. Re: JConsole doesn't work anymore
            David Lloyd Master

            Inicidentally I tried adding various jars to the boot classpath just to see if I could make it work - after about three I gave up though. It's a shame that this doesn't work...

            • 3. Re: JConsole doesn't work anymore
              jaikiran pai Master

              I tried a couple of things. And i think the subject of this thread might need a change :)

              JConsole does work in JBoss-5 CR2. I followed these steps here http://www.jboss.org/community/docs/DOC-12499

              However, displaying of JBoss MBeans in JConsole as explained here http://www.jboss.org/community/docs/DOC-10521, no longer works because of the classpath issue.

              I tried bringing the jboss-system-jmx.jar into the boot classpath (just for testing). That got me to a point where i could see JBoss booting but it failed with various other classloader/dependency errors. Let me try a few more things and see if there is a workaround. In any case, should this be reported in the JIRA (or has it been already done)?

              • 4. Re: JConsole doesn't work anymore
                jaikiran pai Master

                The only way, i could get the JBoss MBeans in JConsole working was to manually add the following 2 classes to the %JBOSS_HOME%/bin/run.jar:

                org\jboss\system\server\jmx\LazyMBeanServer.class
                org\jboss\system\server\jmx\MBeanServerBuilderImpl.class

                • 5. Re: JConsole doesn't work anymore
                  jaikiran pai Master

                   

                  "jaikiran" wrote:
                  In any case, should this be reported in the JIRA (or has it been already done)?



                  I could not find a related issue, so created one https://jira.jboss.org/jira/browse/JBAS-6185

                  • 6. Re: JConsole doesn't work anymore
                    David Lloyd Master

                    I tried another approach - namely, specifying that the platform MBean server be used (which would avoid the classpath issue), but the failure is different:

                    10:27:26,880 ERROR [AbstractKernelController] Error installing to Instantiated: name=jboss.system:service=MainDeployer state=Described mode=Manual requiredState=Configured
                    org.jboss.deployment.DeploymentException: Unable to createMBean for jboss.system:service=MainDeployer
                    ...
                    Caused by: javax.management.InstanceNotFoundException: JMImplementation:type=MBeanRegistry
                     at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.getMBean(DefaultMBeanServerInterceptor.java:1094)
                     at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:833)
                     at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:761)
                     at org.jboss.system.ServiceCreator.installPlainMBean(ServiceCreator.java:203)
                     at org.jboss.system.ServiceCreator.install(ServiceCreator.java:115)
                    


                    The exact properties I set were:
                    -Dcom.sun.management.jmxremote -Djboss.platform.mbeanserver=true
                    


                    Perhaps there's something somewhere that isn't respecting this setting...

                    • 7. Re: JConsole doesn't work anymore
                      David Lloyd Master

                      ...which is of course exactly what http://www.jboss.org/community/docs/DOC-10521 is about, so... ignore me...

                      • 8. Re: JConsole doesn't work anymore
                        David Ward Master

                        David L,

                        Funny, I didn't see this forum posting, so of course I went through my own attempt iteration in this comment:
                        http://www.jboss.org/community/docs/DOC-10521#comment-1390

                        Glad to see I'm not the only one who has hit this. :)

                        David W