我下载并解压缩了最新的ActiveMQ版本5.17.1。我使用的是Java11.0.11和Windows10EnterpriseBuild: 19044.1706。
当我通过.\bin\activemq.bat start
启动.\bin\activemq.bat start
时,我得到了这个FileNotFoundException
WARN | Store limit is 102400 mb (current store usage is 0 mb). The data directory: C:\Programs\apache-activemq-5.17.1\bin\..\data\kahadb only has 21729 mb of usable space. - resetting to maximum available disk space: 21729 mb
WARN | Temporary Store limit is 51200 mb (current store usage is 0 mb). The data directory: C:\Programs\apache-activemq-5.17.1\bin\..\data only has 21728 mb of usable space. - resetting to maximum available disk space: 21728 mb
INFO | ActiveMQ WebConsole available at http://127.0.0.1:8161/
INFO | ActiveMQ Jolokia REST API available at http://127.0.0.1:8161/api/jolokia/
WARN | jolokia-agent: Error while accessing access restrictor at file:C:Programsapache-activemq-5.17.1bin..conf/jolokia-access.xml. Denying all access to MBeans for security reasons. Exception: java.io.FileNotFoundException: C:Programsapache-activemq-5.17.1bin..conf\jolokia-access.xml (The system cannot find the path specified)
java.io.FileNotFoundException: C:Programsapache-activemq-5.17.1bin..conf\jolokia-access.xml (The system cannot find the path specified)
at java.io.FileInputStream.open0(Native Method) ~[?:?]
at java.io.FileInputStream.open(FileInputStream.java:219) ~[?:?]
at java.io.FileInputStream.<init>(FileInputStream.java:157) ~[?:?]
at java.io.FileInputStream.<init>(FileInputStream.java:112) ~[?:?]
如何修复这个FileNotFoundException
?
这似乎是文件名(即C:Programsapache-activemq-5.17.1bin..conf\jolokia-access.xml
)的一些问题。
我甚至不确定是否应该信任FileNotFoundException
错误消息。
发布于 2022-06-10 13:40:24
设置Windows环境变量时
ACTIVEMQ_HOME=C:/Programs/apache-activemq-5.17.1/
我能解决这个问题(注意后面的斜杠)。这个错误就消失了。
但我注意到了更多的事情:
ACTIVEMQ_HOME=C:/Programs/apache-activemq-5.17.1
,则仍然存在这个问题。ACTIVEMQ_HOME=C:\Programs\apache-activemq-5.17.1\
,我仍然会遇到问题(也就是说,如果我使用反斜杠)。ACTIVEMQ_HOME
,我也会遇到问题。因此,这似乎是ActiveMQ Windows启动脚本activemq.bat
中的一个bug。它不应该对这个值太敏感。而且,它应该可以在没有设置ACTIVEMQ_HOME
的情况下工作(但它不能工作)。
https://stackoverflow.com/questions/72574570
复制相似问题