ActiveMQ startup problem on Windows - FileNotFoundException for jolokia-access.xml

Viewed 964

I downloaded and unzipped the latest ActiveMQ version 5.17.1. I'm using Java 11.0.11 and Windows 10 Enterprise Build: 19044.1706.

When I started ActiveMQ via .\bin\activemq.bat start I got this 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) ~[?:?]

How do I fix this FileNotFoundException?

It seems to be some problem with the file names (i.e. C:Programsapache-activemq-5.17.1bin..conf\jolokia-access.xml).

I am not even sure if I should trust the FileNotFoundException error message.

4 Answers

I kind of agree this needs to be fixed from ActiveMq side. But to resolve this issue you can set Environment Variable as -

ACTIVEMQ_HOME=C:\\Programs\\apache-activemq-5.17.1\\

It worked for me

When I set a Windows environment variable

ACTIVEMQ_HOME=C:/Programs/apache-activemq-5.17.1/

I am able to solve the problem (note the trailing slash). The error disappears then.

But I noticed a few more things:

  1. If I set the variable to ACTIVEMQ_HOME=C:/Programs/apache-activemq-5.17.1 I still have that problem.

  2. If I set ACTIVEMQ_HOME=C:\Programs\apache-activemq-5.17.1\ I still have the problem (i.e. if I use backslashes).

  3. If I don't have a Windows environment variable ACTIVEMQ_HOME defined at all, I also have the problem.

So this seems like a bug in the ActiveMQ Windows startup script activemq.bat. It should not be so sensitive to this value. Also it should work without ACTIVEMQ_HOME being set at all (but it doesn't work).

Based on input in the Active MQ Jira issue, I replaced ${prop:activemq.conf} with the following in the D:\Program Files\activemq\webapps\api\WEB-INF\web.xml

    <init-param>
    <param-name>policyLocation</param-name>
    <param-value>file:D:/Program Files/activemq/conf/jolokia-access.xml</param-value>
</init-param>

Afterwhich, the error is not thrown.

Related