我有一个 Tomcat 8 实例。我正在尝试从 JColsole 连接到它。为此,我在 setenv.bat
中添加了以下行:
CATALINA_OPTS=%CATALINA_OPTS% -Dcom.sun.management.jmxremote.password.file=D:\Utils\Apache\Tomcat\conf\remote.users -Dcom.sun.management.jmxremote.access.file=D:\Utils\Apache\Tomcat\conf\remote.acl -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=7777 -Dcom.sun.management.jmxremote.ssl=false -Djava.rmi.server.hostname=localhost
在这两个文件 -- remote.users
和 remote.acl
中,我定义了用户 test 和密码 test 和角色 readwrite。
但是我无法通过 JConsole 连接(我尝试使用 url localhost:7777
和 service:jmx:rmi://localhost:7777
)。
进一步的调查表明,我什至无法远程登录到 7777。
我做错了什么?
最佳答案
碰巧,当 Tomcat 在 Windows 上作为服务运行时,我不需要 setenv.bat
,我需要使用 tomcat8w.exe
-- GUI添加选项的费用
关于java - 如何检查 JMX 代理是否在 Tomcat 中工作?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28477007/