Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Connect to JBoss 7 using VisualVM

I have remote JBoss 7.1 server and I would like to connect to this server by using VisualVM or JConsole.

I googled a bit and found several threads/tutorials on how to connect to JBoss 7.1 by using VisualVM or JCoonsole, e.g.:

  • https://community.jboss.org/thread/171346?start=0&tstart=0
  • https://issues.jboss.org/browse/WFLY-895
  • https://community.jboss.org/wiki/UsingJconsoleToConnectToJMXOnAS7
  • http://blog.akquinet.de/2012/11/01/connecting-visualvm-with-a-remote-jboss-as-7-eap6-jvm-process/

Unfortunately I had no luck in connecting to my JBoss 7.1 over JMX.

Do you have any ideas how to connect to JBoss 7.1 with VisualVM?

EDIT: I added -Dcom.sun.management.jmxremote.port=1090 -Dcom.sun.management.jmxremote.authenticate=false to standalone.conf.bat, but I got an exception: Caused by: java.lang.IllegalStateException: The LogManager was not properly inst alled (you must set the "java.util.logging.manager" system property to "org.jboss.logmanager.LogManager").

So, I added another option to JAVA_OPTS: -Dcom.sun.management.jmxremote.port=1090 -Dcom.sun.management.jmxremote.authenticate=false -Djava.util.logging.manager=org.jboss.logmanager.LogManager but the exception I receive is this:

Could not load Logmanager "org.jboss.logmanager.LogManager"
java.lang.ClassNotFoundException: org.jboss.logmanager.LogManager
        at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
like image 640
Ernestas Kardzys Avatar asked Oct 02 '13 11:10

Ernestas Kardzys


1 Answers

Found a solution. I needed to add the following params to JAVA_OPTS in standalone.conf.bat:

-Dcom.sun.management.jmxremote.port=1090 ^
-Dcom.sun.management.jmxremote.authenticate=false ^
-Dcom.sun.management.jmxremote ^
-Dcom.sun.management.jmxremote.ssl=false ^
-Djava.util.logging.manager=org.jboss.logmanager.LogManager ^
-Xbootclasspath/p:<JBOSS_PATH>/modules/org/jboss/logmanager/main/jboss-logmanager-1.2.2.GA.jar ^
-Xbootclasspath/p:<JBOSS_PATH>/modules/org/jboss/logmanager/log4j/main/jboss-logmanager-log4j-1.0.0.GA.jar ^
-Xbootclasspath/p:<JBOSS_PATH>/modules/org/apache/log4j/main/log4j-1.2.16.jar -Djboss.modules.system.pkgs=org.jboss.logmanager

Note 1: Use \ instead of ^ on Unix.

Note 2: Replace <JBOSS_PATH> with your JBoss 7.x installation path. Mine was c:/java/jboss-as-7.1.1.Final.

like image 53
Ernestas Kardzys Avatar answered Oct 28 '22 03:10

Ernestas Kardzys