Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Wildfly 8 Final - jconsole can't connect remotely

Good day, people,

I am trying to use jconsole to connect to remote Wildfly 8 Final servers. That did not work: Connection failed. After multiple tries and failures I attempted to make it connect at least to my 'localhost' jboss, but even that is not working. No errors, it simply doesn't connect and says "Connection failed".

Details:

  1. Wildfly 8 Final server
  2. Using jconsole from wildfly_installation/bin/jconsole.bat
  3. Management users created. Tried with and without the username/password.
  4. The standalone.xml is the original one, shipped with Wildfly 8 Final without changes
  5. The url that I plug in jconsole to connect to is: service:jmx:remoting-jmx://localhost:9999
  6. The Wildfly/jboss doesn't have anything deployed in it, no WARs/EARs.
  7. Java version is 1.7 release 51. The latest on the moment of writing.
  8. JAVA_HOME points to the only java 1.7 installed on the system.
  9. JConsole can connect to local java process and works, but not remote connection.

Basically it's a brand new installation of Wildfly 8 Final with management user created and jconsole doesn't connect remotely to it.

What else I've tried: I've read many posts on people having troubles with jconsole and Jboss AS 7.x. I have tried the suggestions from those threads, but none worked. Also it seems Wildfly 8 has different JMX version (1.3 vs 1.1 in Jboss 7.x), so I assume that's why standalone.xml suggestions from Jboss 7.x didn't work for Wildfly 8 Final.

like image 552
user2113581 Avatar asked Mar 06 '14 00:03

user2113581


1 Answers

Java Mission Control JMX console and Flight Recorder profiler work on WildFly as well.

As already noted the proper JMX connection string is:

service:jmx:http-remoting-jmx://{insert server ip here}:9990

It requires a management user (details on the bottom).

As for the Flight Recorder, these should be added to the server runtime configuration in standalone.conf(.bat):

JAVA_OPTS=%JAVA_OPTS% -XX:+UnlockCommercialFeatures -XX:+FlightRecorder -XX:FlightRecorderOptions=defaultrecording=true

On a workstation where you want to run Java Mission Control you need to adjust the classpath in jmc.ini (located in bin directory of your JDK):

-Xbootclasspath/a:c:\Program Files\Java\jdk1.7.0_67\lib\jconsole.jar;c:\Program Files\Java\jdk1.7.0_67\lib\tools.jar;c:\wildfly-8.1.0.Final\bin\client\jboss-cli-client.jar`

Prerequisites (you most likely already configured this):

  1. this assumes that you have installed JDK on workstation in c:\Program Files\Java\jdk1.7.0_67\
  2. this assumes that you have installed WildFly on workstation in c:\wildfly-8.1.0.Final
  3. on the server you need to have proper bind.address configurations (or <any-address>) in standalone.xml:

<interfaces>
    <interface name="management">
        <any-address/>
    </interface>
    <interface name="public">
        <any-address/>
    </interface>
    <interface name="unsecure">
        <any-address/>
    </interface>
</interfaces> 
  1. You need to have a management user on the server, which you can add by using \bin\add-user.bat(.sh).

To test this connect to http://{insert server ip here}:9990 with a web browser which will open the server's web UI console.

Best regards!

like image 94
ziga Avatar answered Oct 05 '22 23:10

ziga