在阅读并尝试了很多之后,我不得不问是否有人能解决我的问题.
我试图在防火墙后面设置一些Tomcats(V6).这没什么大不了的 - 但我想通过JMX监控它们.
我阅读了TC文档并遇到了JMXRemoteLifecycleListener.我的测试TC安装完全按照上面的链接设置.因此,我没有从我们网络中的一个主机到另一个主机的连接.此外,每次启动TC时都会打开第三个随机端口.
在我的server.xml中,监听器被激活
<Listener className="org.apache.catalina.mbeans.JmxRemoteLifecycleListener"
rmiRegistryPortPlatform="8050" rmiServerPortPlatform="8060" />
Run Code Online (Sandbox Code Playgroud)
catalina.out说一切都好.
2011-06-14 16:46:48,819 [main] INFO org.apache.catalina.mbeans.JmxRemoteLifecycleListener-
The JMX Remote Listener has configured the registry on port 8050 and the server on port 8060 for the Platform server
Run Code Online (Sandbox Code Playgroud)
端口是开放的,我可以通过telnet从任何其他主机连接到它们.我可以用(service:jmx:rmi://<hostname>:8xxx/jndi/rmi://<hostname>:8xxxx/jmxrmi)本地连接到vm
Netstats输出如下:
tcp6 0 0 :::8080 :::* LISTEN 11291/java
tcp6 0 0 :::8050 :::* LISTEN 11291/java
tcp6 0 0 :::8060 :::* LISTEN 11291/java
tcp6 0 0 127.0.0.1:8005 :::* LISTEN 11291/java
tcp6 0 0 :::60901 :::* LISTEN 11291/java
tcp6 …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用Ubuntu计算机上的JConsole工具连接到在另一台计算机上运行的远程Java进程。
这就是我在远程计算机上运行Java程序的方式:
sudo java -Dcom.sun.management.jmxremote.port = 51082 -Dcom.sun.management.jmxremote.authenticate = false -Dcom.sun.management.jmxremote.ssl = false -jar myfile.jar
我在我的机器上像这样运行JConsole命令:
jconsole-调试-J-Djava.util.logging.config.file = Logging.properties
这是我的Logging.properties文件:
handlers = java.util.logging.ConsoleHandler
sun.rmi.level=FINEST
.level = INFO
java.util.logging.ConsoleHandler.level = FINEST
java.util.logging.ConsoleHandler.formatter = \
java.util.logging.SimpleFormatter
// Use FINER or FINEST for javax.management.remote.level - FINEST is
// very verbose...
javax.management.level = FINEST
javax.management.remote.level = FINER
Run Code Online (Sandbox Code Playgroud)
现在在我的Jconsle UI上,我给出了以下属性:

当我单击Connect按钮时,出现异常提示:
FINER: [javax.management.remote.rmi.RMIConnector: jmxServiceURL=service:jmx:rmi:///jndi/rmi://my-remote-host:51082/jmxrmi] failed to connect: java.lang.SecurityException: Expecting a sun.rmi.server.UnicastRef2 remote reference in stub!
java.lang.SecurityException: Expecting a sun.rmi.server.UnicastRef2 remote reference …Run Code Online (Sandbox Code Playgroud)