Skip to end of metadata
Go to start of metadata

The JMX subsystem registers a service with the Remoting endpoint so that remote access to JMX can be obtained over the exposed Remoting connector.

This is switched on by default in standalone mode and accessible over port 9999 but in domain mode is switched off so needs to be enabled - in domain mode the port will be the port of the Remoting connector for the AS instance to be monitored.

To use the connector you can access it in the standard way using a service:jmx URL:

You also need to set your classpath when running the above example.  The following script covers Linux.  If your environment is much different, paste your script when you have it working.

!/bin/bash

# specify your AS7 folder
export YOUR_AS7_HOME=~/as7

java -classpath $YOUR_AS7_HOME/bin/client/jboss-client.jar:./ JMXExample

You can also connect using jconsole.

If using jconsole use the jconsole.sh and jconsole.bat scripts included in the bin folder of the AS distribution as these set the classpath as required to connect over Remoting.

In addition to the standard JVM MBeans, the JBoss AS 7 MBean server contains the following MBeans:

JMX ObjectName Description
jboss.msc:type=container,name=jboss-as Exposes management operations on the JBoss Modular Service Container, which is the dependency injection framework at the heart of JBoss AS 7. It is useful for debugging dependency problems, for example if you are integrating your own subsystems, as it exposes operations to dump all services and their current states
jboss.naming:type=JNDIView Shows what is bound in JNDI
jboss.modules:type=ModuleLoader,name=* This collection of MBeans exposes management operations on JBoss Modules classloading layer. It is useful for debugging dependency problems arising from missing module dependencies
Labels:
None
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.
  1. Feb 22, 2012

    The tag <jmx-connector> has been removed in AS 7.1. The article needs revision.
    Also needs information on usage of jconsole.sh.

    Look forward to an update :)

  2. Feb 26, 2012

    I get the following exception when I run above piece of code.

    Exception in thread "main" java.net.MalformedURLException: Unsupported protocol: remoting-jmx
        at javax.management.remote.JMXConnectorFactory.newJMXConnector(Unknown Source)
        at javax.management.remote.JMXConnectorFactory.connect(Unknown Source)
        at com.pcs.obix.JMXExample.main(JMXExample.java:19)

    Yes I fixed the issue, It was because jboss-client-7.1.0.Final.jar was missing.

    1. Feb 24, 2012

      If your using an older AS7 distribution (e.g. 7.0.*), try the older (RMI based) instructions link for AS 7.0

  3. Mar 15, 2012

    Hi, how can I expire a session in AS7.1 Final?

    In jboss-5.1.0.GA, there was an mbean named
    jboss.web:type=Manager,path=/MySampleApp,host=localhost
    and its methods expireSession,listSessionIds.

    But I couldn't find this in AS7.1 Final. Please help.

    1. Mar 15, 2012

      Ok, I got the answer. I need to add the entry

      <system-properties>
              <property name="org.apache.tomcat.util.ENABLE_MODELER" value="true"/>
          </system-properties>

      in standalone-full-ha.xml. Which will solve the issue.

  4. May 15, 2012

    I was getting the error: Exception in thread "main" java.net.MalformedURLException: Unsupported protocol: remoting-jmx

    This was because of the classpath not being set.

    I found the "adding the classpath" section confusing.

    I was just trying to get remote JMX working where my client was my local IDE and the remote ejb part was on my companies non local server.

    I just added jboss-client.jar as a dependency of my test project in my IDE and I no longer got the MalformedURLException error. It then complained about authentication failure.

    I added authentication in this manner:

    .......

            String username = "DragonballZ";
            String password = "Goku55";
            HashMap env = new HashMap();
            String[] creds = new String[2];
            creds[0] = username;
            creds[1] = password;
            env.put(JMXConnector.CREDENTIALS, creds);

            JMXConnector jmxConnector = JMXConnectorFactory.connect(serviceURL, env);

    ........

    Hope this helps someone

    1. Apr 07, 2014

      Hi David,

      i am also bit confused with "adding the classpath" can you please let me know where exactly i should add .

      Thanks,

      Vishal

  5. Nov 07, 2012

    I would like to expose the beans assoctied to “jboss.web:type=*”, so I configured standalone.xml with as mentioned:

    <system-properties>
            <property name="org.apache.tomcat.util.ENABLE_MODELER" value="true"/>
    </system-properties>

    Setting the value to "true" throws the exception listed below.

    I also noticed that, independent of this configuration, datasource (ExampleDS) statistics on my sample app are displayed on JConsole as "unavailable". They can be queried however using jboss-cli tool.

    Is there any further documentation about this system property?

    Thanks

    15:41:19,231 INFO  [org.apache.catalina.core.StandardPipeline] (MSC service thread 1-4) Can't register valve org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve[/bookmark-23]: java.lang.NoClassDefFoundError: javax/servlet/ServletException
        at java.lang.Class.getDeclaredMethods0(Native Method) [rt.jar:1.6.0_26]
        at java.lang.Class.privateGetDeclaredMethods(Class.java:2427) [rt.jar:1.6.0_26]
        at java.lang.Class.privateGetPublicMethods(Class.java:2547) [rt.jar:1.6.0_26]
        at java.lang.Class.getMethods(Class.java:1410) [rt.jar:1.6.0_26]
        at org.apache.tomcat.util.modeler.modules.MbeansDescriptorsIntrospectionSource.createManagedBean(MbeansDescriptorsIntrospectionSource.java:304) [jbossweb-7.0.13.Final.jar:]
        at org.apache.tomcat.util.modeler.modules.MbeansDescriptorsIntrospectionSource.execute(MbeansDescriptorsIntrospectionSource.java:84) [jbossweb-7.0.13.Final.jar:]
        at org.apache.tomcat.util.modeler.modules.MbeansDescriptorsIntrospectionSource.loadDescriptors(MbeansDescriptorsIntrospectionSource.java:77) [jbossweb-7.0.13.Final.jar:]
        at org.apache.tomcat.util.modeler.Registry.load(Registry.java:753) [jbossweb-7.0.13.Final.jar:]
        at org.apache.tomcat.util.modeler.Registry.loadDescriptors(Registry.java:867) [jbossweb-7.0.13.Final.jar:]
        at org.apache.tomcat.util.modeler.Registry.findManagedBean(Registry.java:650) [jbossweb-7.0.13.Final.jar:]
        at org.apache.tomcat.util.modeler.Registry.findManagedBean(Registry.java:964) [jbossweb-7.0.13.Final.jar:]
        at org.apache.tomcat.util.modeler.Registry.registerComponent(Registry.java:793) [jbossweb-7.0.13.Final.jar:]
        at org.apache.catalina.core.StandardPipeline.registerValve(StandardPipeline.java:308) [jbossweb-7.0.13.Final.jar:]
        at org.apache.catalina.core.StandardPipeline.start(StandardPipeline.java:237) [jbossweb-7.0.13.Final.jar:]
        at org.apache.catalina.core.StandardContext.start(StandardContext.java:3786) [jbossweb-7.0.13.Final.jar:]
        at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:90) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]
        at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)
        at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_26]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_26]
        at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_26]
    Caused by: java.lang.ClassNotFoundException: javax.servlet.ServletException from [Module "org.jboss.as.jpa:main" from local module loader @3a6ac461 (roots: /opt/monlab/jboss-as-7.1.1.Final/modules)]
        at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)

  6. Nov 30, 2012

    Renato,

    Have you found a solution to fixing the above stacktrace?

    ~Rick

  7. Nov 30, 2012

    Ah, got it -- just add the following line to the dependencies section for the org.jboss.as.jpa module:

            <module name="javax.servlet.api"/>

    The module descriptor is located at $JBOSS_HOME/modules/org/jboss/as/jpa/main/module.xml.

    main.xml
    1. Dec 05, 2012

      Thanks, Rick. Problem solved!

    2. Mar 29, 2013

      I-'m running 7.1 Final and followed your advice and Aslam's. No exceptions, but query '.:*' never reveals any Managers under jboss. Does this have to be standalone-full-ha.xml, or can we get away with just standalone.xml?-

      Nevermind. Problem solved. Simple configuration misunderstanding :-P