Issue
I am a newbie to Apache ActiveMQ. I am following the instructions from here
I don't need multiple instances of ActiveMQ. I'm just trying a HelloWorld using ActiveMQ. But when I start I get the following below error:
vinod@BBLPT0326:/srv/activemq/current$ /etc/init.d/activemq start
INFO: Loading '/etc/default/activemq'
INFO: Using java '/opt/software/java/bin/java'
INFO: Starting - inspect logfiles specified in logging.properties and log4j.properties to get details
/etc/init.d/activemq: 300: /etc/init.d/activemq: "/opt/software/java/bin/java" -Xms1G -Xmx1G -Djava.util.logging.config.file=logging.properties -Djava.security.auth.login.config=/srv/activemq/apache-activemq-5.11.1/conf/login.config -Dcom.sun.management.jmxremote -Djava.awt.headless=true -Djava.io.tmpdir="/srv/activemq/apache-activemq-5.11.1/tmp" -Dactivemq.classpath="/srv/activemq/apache-activemq-5.11.1/conf:" -Dactivemq.home="/srv/activemq/apache-activemq-5.11.1" -Dactivemq.base="/srv/activemq/apache-activemq-5.11.1" -Dactivemq.conf="/srv/activemq/apache-activemq-5.11.1/conf" -Dactivemq.data="/srv/activemq/apache-activemq-5.11.1/data" -jar "/srv/activemq/apache-activemq-5.11.1/bin/activemq.jar" start /dev/null 2>&1 &
RET="$?"; APID="$!";
echo $APID > /srv/activemq/apache-activemq-5.11.1/data/activemq.pid;
echo "INFO: pidfile created : '/srv/activemq/apache-activemq-5.11.1/data/activemq.pid' (pid '$APID')";exit $RET: not found
When tried with sudo
I get a different error:
vinod@BBLPT0326:/srv/activemq/current$ sudo /etc/init.d/activemq start
INFO: Loading '/etc/default/activemq'
ERROR: Configuration variable JAVA_HOME or JAVACMD is not defined correctly.
(JAVA_HOME='', JAVACMD='java')
My JAVA_HOME
is defined. I verified the same as below.
vinod@BBLPT0326:/srv/activemq/current$ echo $JAVA_HOME
/opt/software/java
I already referred solution here as I am using Ubuntu 14.0.4.
But I am not really clear as I don't have a path /etc/activemq/instances-enabled
and from where should I execute the command sudo ln -s ../instances-available/main/
?
Solution
I am answering my own question here.
In ubuntu 14.0.4 root cause of the problem is
INFO: Loading '/etc/default/activemq' ERROR: Configuration variable JAVA_HOME or JAVACMD is not defined correctly. (JAVA_HOME='', JAVACMD='java')
Even if you define JAVA_HOME in /etc/environment, active MQ reads only from either of the below locations where ever if finds the file first.
- /etc/default/activemq
- $HOME/.activemqrc
- $INSTALLDIR/apache-activemq-/bin/env
So I recommend defining JAVA_HOME in /etc/default/activemq (which is copied from $INSTALLDIR/apache-activemq-/bin/env)
I did as below
JAVA_HOME="/opt/software/java/jre" JAVACMD="/opt/software/java/jre/bin/java"
Answered By - Vinod Jayachandran Answer Checked By - Mildred Charles (WPSolving Admin)