当我尝试使用JMX来监控这样的应用程序时:
java -Dcom.sun.management.jmxremote.port=9999 \
-Dcom.sun.management.jmxremote.authenticate=false \
-Dcom.sun.management.jmxremote.ssl=false \
JMX_tester
它告诉我:
Error: Password file read access must be restricted:
/usr/lib/jvm/java-7-oracle/jre/lib/management/jmxremote.password
然而,当我使用chmod
限制读取权限时,它会告诉我:
Error: can't read password file
我疯了还是什么?我该如何解决这个问题?
这是Ubuntu btw,带有最新的oracle jdk
答案 0 :(得分:45)
确保您用于运行java进程的用户可以访问该文件(所有者/读取权限)。
尝试:
chmod 600 jmxremote.password
另外,我建议你制作自己的密码文件并用
运行-Dcom.sun.management.jmxremote.password.file=pwFilePath
所有解释here。