Enabling JMX in JBoss AS 6 and JDK 6
I'm trying to create a demo of VisualVM (a really neat BCI tool that now ships with Oracle's JDK 6) connecting to Red Hat's JBoss Application Server 6. The wrinkle is that there is some interaction with JBoss' LogManager when JMX is turned on. This results in a torrent of class not found exceptions when starting up the Application Server.
Note that the above example turns off all authentication for JMX connections.. not something you'd want to do on a server that's on a public IP. But I am lazy.. in any case, if you're using Linux, you can use IPTables to restrict which IP's can connect to your JMX port.
To quell these errors, the following lines have to be added to the run.conf:
# stuff for JMX
JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.port=6789"
JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.ssl=false"
JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.authenticate=false"
JAVA_OPTS="$JAVA_OPTS -Djava.rmi.server.hostname=your.jboss.ip.address"
JAVA_OPTS="$JAVA_OPTS -Djboss.platform.mbeanserver"
JAVA_OPTS="$JAVA_OPTS -Djavax.management.builder.initial=org.jboss.system.server.jmx.MBeanServerBuilderImpl"
# there's an interaction between JDK 6 and JBoss LogManager when JMX is turned on..
JAVA_OPTS="$JAVA_OPTS -Djava.util.logging.manager=org.jboss.logmanager.LogManager"
JAVA_OPTS="$JAVA_OPTS -Dorg.jboss.logging.Logger.pluginClass=org.jboss.logging.logmanager.LoggerPluginImpl"
JBOSS_CLASSPATH="$JBOSS_CLASSPATH:/home/orly/sw/jboss-6.0.0.Final/lib/jboss-logmanager.jar"
Note that the above example turns off all authentication for JMX connections.. not something you'd want to do on a server that's on a public IP. But I am lazy.. in any case, if you're using Linux, you can use IPTables to restrict which IP's can connect to your JMX port.
'Java' 카테고리의 다른 글
Enabling JMX Remote (0) | 2013.10.30 |
---|---|
Java 빌드 도구 Apache Ant (0) | 2012.03.27 |
Java API 문서 생성도구 javadoc 사용하기 (0) | 2012.03.26 |
Java 컴파일러 javac 옵션 사용하기 - 관련된 소스 및 클래스 파일 위치 지정(-sourcepath, -classpath) (0) | 2012.03.26 |
Java 컴파일러 javac 옵션 사용하기 - 클래스 파일의 생성위치 지정(-d) (0) | 2012.03.26 |