简体   繁体   中英

Connecting to JBoss 7.1.1 MBean remotely

After implementing a MBean in our project (deployed on a JBoss AS 7.1.1 in standalone mode), I've performed some testing using JConsole and creating a "Local Process" connection (the one that uses the JBoss PID) and this worked fine. The MBean can be seen, reached and returns the expected value. However I am not able to connect using the "Remote Process".

JConsole新连接屏幕

This is the JMX subsystem configuration:

    <subsystem xmlns="urn:jboss:domain:jmx:1.1">
        <show-model value="true"/>
        <remoting-connector use-management-endpoint="true"/>
    </subsystem>

And this is the socket configuration:

<socket-binding-group name="standard-sockets" default-interface="public" port-offset="${jboss.socket.binding.port-offset:0}">
    <socket-binding name="management-native" interface="management" port="${jboss.management.native.port:9995}"/>
    <socket-binding name="management-http" interface="management" port="${jboss.management.http.port:9990}"/>
    <socket-binding name="management-https" interface="management" port="${jboss.management.https.port:9443}"/>
    <socket-binding name="ajp" port="8009"/>
    <socket-binding name="http" port="8080"/>
    <socket-binding name="https" port="8443"/>
    <socket-binding name="osgi-http" interface="management" port="8090"/>
    <socket-binding name="remoting" port="4447"/>
    <socket-binding name="txn-recovery-environment" port="4712"/>
    <socket-binding name="txn-status-manager" port="4713"/>
    <outbound-socket-binding name="mail-smtp">
        <remote-destination host="localhost" port="25"/>
    </outbound-socket-binding>
</socket-binding-group>

I've found several tastes for the URL to use in there, but I've tried them with the different suggested ports (9990, 9995, 1090, 4447) without success:

  • service:jmx:remoting-jmx://127.0.0.1:9995
  • service:jmx:rmi:///jndi/rmi://127.0.0.1:9995/jmxrmi

The error doesn't bring much information and says "The connection to ... did not succeed"

I've configured my JBoss according to the information found here:

I think I have the correct configuration for JBoss 7.1.1 and then the port should be the 'management-native' one (9995), but there has to be something missing in here. Does anyone knows what could be?

Many thanks in advance!

Using your port configuration, the service:jmx:remoting-jmx://127.0.0.1:9995 URL works for me, with:

  1. Use <jboss-home>/bin/jconsole.sh (or bat) to launch jconsole. This includes the required classpath.
  2. Make sure your JBOSS_HOME env var is correctly set. I run a couple of different versions and got burned by this.
  3. You need to use a valid management user and password. Not using those credentials (or invalid ones) gives you the same non-obvious error messages.

So when using remoting-jmx , the target port should be the one defined in <socket-binding name="management-native" interface="management" port="${jboss.management.native.port:9995}"/>

As I understand it, when using http-remoting-jmx , the target port should be the one defined in <socket-binding name="management-http" interface="management" port="${jboss.management.http.port:9990}"/> but I have never been able to get this to work.

I'm not completely sold on these new protocols, so I frequently deploy a JMXMP ConnectionServer.... problem solved.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM