2
votes

I have installed ActiveMQ Artemis on my office laptop. I created a broker, and from the broker's bin folder I ran artemis-exe install. Then after that I ran the start command. It shows it has started but, when I check status it shows stopped. I cannot access localhost:8161. Here is my log file:

2020-09-07 12:30:45,458 DEBUG - Starting WinSW in the CLI mode
2020-09-07 12:30:46,033 INFO  - Starting the service with id 'artemis-btBroker-0.0.0.0'
2020-09-07 12:30:46,737 DEBUG - Starting WinSW in the service mode
2020-09-07 12:30:46,837 DEBUG - Completed. Exit code is 0
2020-09-07 12:30:46,881 INFO  - Starting %JAVA_HOME%\bin\java.exe  -Xbootclasspath/a:C:\Users\613379463\Downloads\apache-artemis-2.15.0-bin\apache-artemis-2.15.0\lib\jboss-logmanager-2.1.10.Final.jar;C:\Users\613379463\Downloads\apache-artemis-2.15.0-bin\apache-artemis-2.15.0\lib\wildfly-common-1.5.2.Final.jar -XX:+UseParallelGC -Xms512M -Xmx1024M -classpath C:\Users\613379463\Downloads\apache-artemis-2.15.0-bin\apache-artemis-2.15.0\lib\artemis-boot.jar -Dartemis.home=C:\Users\613379463\Downloads\apache-artemis-2.15.0-bin\apache-artemis-2.15.0 -Dartemis.instance=C:\Users\613379463\Downloads\apache-artemis-2.15.0-bin\apache-artemis-2.15.0\bin\btBroker -Ddata.dir=C:\Users\613379463\Downloads\apache-artemis-2.15.0-bin\apache-artemis-2.15.0\bin\btBroker\data -Dartemis.instance.etc=C:\Users\613379463\Downloads\apache-artemis-2.15.0-bin\apache-artemis-2.15.0\bin\btBroker\etc -Djava.util.logging.manager=org.jboss.logmanager.LogManager -Dlogging.configuration=file:/C:/Users/613379463/Downloads/apache-artemis-2.15.0-bin/apache-artemis-2.15.0/bin/btBroker/etc//logging.properties -Djava.security.auth.login.config=C:\Users\613379463\Downloads\apache-artemis-2.15.0-bin\apache-artemis-2.15.0\bin\btBroker\etc\login.config -Dhawtio.realm=activemq -Dhawtio.offline="true" -Dhawtio.role=amq -Dhawtio.rolePrincipalClasses=org.apache.activemq.artemis.spi.core.security.jaas.RolePrincipal -Djolokia.policyLocation=file:/C:/Users/613379463/Downloads/apache-artemis-2.15.0-bin/apache-artemis-2.15.0/bin/btBroker/etc//jolokia-access.xml org.apache.activemq.artemis.boot.Artemis run 
2020-09-07 12:30:47,081 DEBUG - Completed. Exit code is 0
1
Can you share the file C:/Users/613379463/Downloads/apache-artemis-2.15.0-bin/apache-artemis-2.15.0/bin/btBroker/log/artemis.log?. If the file artemis.log doesn't exist could you execute the starting command %JAVA_HOME%\bin\java.exe -Xbootclasspath... and share the output? - Domenico Francesco Bruscino
This is the winsw wrapper log file. Please share the winsw.out.log file. It contains the logs of application you run using winsw. Also you can use windows event manager to see what happen during the execution. - Buddhika Chathuranga
the issues has been resolved. there was some issue with my JAVA_HOME. it was not loading - Apurv Adarsh

1 Answers

1
votes

The Artemis ActiveMQ service is known to start and immediately stop (without any errors shown on command line) if %JAVA_HOME% is not set, as Apurv Adarsh's comment mentions.

The solution is to set the env var and then run the service as normal, as follows:

(1) Set JAVA_HOME

Verify %JAVA_HOME% system environment variable exists:

echo $Env:JAVA_HOME # from PowerShell
echo %JAVA_HOME% # from cmd
# e.g. 'C:\Program Files\Java\jdk-10.0.2\' 
# or blank if not set.

if not, find java.exe (download/install, if necessary):

> where.exe java.exe # from PowerShell
> where java.exe # from cmd
# C:\Program Files (x86)\Common Files\Oracle\Java\javapath\java.exe
# C:\Program Files\Java\jdk-10.0.2\bin\java.exe

Set JAVA_HOME env var, I'll choose the jdk-10.0.2 version. /M will set as system variable, instead of user var. btw, no need to include '/bin/java.exe'

> setx /M JAVA_HOME "C:\Program Files\Java\"

SUCCESS: Specified value was saved.

(Restart the prompt to load the newly set env variable.)

(2) Install & Start Artemis Windows Service

cd into Artemis ActiveMQ root directory. Let my_broker be the name of the broker instance already created.

Ensure service is installed, then start:

> "my_broker/bin/artemis-service" install
...
> "my_broker/bin/artemis-service" start
2021-01-01 12:00:00,000 INFO  - Starting the service with id 'artemis-my_broker-0.0.0.0'

(3) Check Running Status:

Verify service status is running:

> "my_broker/bin/artemis-service" status
Started