12

I'm trying to run activemq on my ubuntu virtual machine but have constantly been running into issues getting it to start up. I've tried downloading the binary and source with no luck. Currently I have downloaded the source, run "mvn clean install -Dmaven.test.skip=true" and mvn reported successful installation. I then hunted around in my .m2 folder found apache-activemq-5.5.1-bin.tar.gz and extracted it to my home/USERNAME dir and attempted to run "bash bin/activemq start" only to receive the following error.

INFO: Loading '/etc/default/activemq'
INFO: Using java '/usr/bin/java'
INFO: Starting - inspect logfiles specified in logging.properties
 and log4j.properties     
to get details
bin/activemq: line 370: /usr/bin/java -Xms256M -Xmx256M -Dorg.apache.activemq.UseDedicatedTaskRunner=true
 -Djava.util.logging.config.file=logging.properties
 -Dcom.sun.management.jmxremote
 -Dactivemq.classpath="/home/jacob/activeMq1/apache-activemq-5.5.1/conf;"
 -Dactivemq.home="/home/jacob/activeMq1/apache-activemq-5.5.1"  
-Dactivemq.base="/home/jacob/activeMq1/apache-activemq-5.5.1"
-jar "/home/jacob/activeMq1/apache-activemq-5.5.1/bin/run.jar" start >/dev/null 2>&1 & 
 RET="$?"; APID="$!";
 echo $APID > /home/jacob/activeMq1/apache-activemq-5.5.1/data/activemq.pid;
 echo "INFO: pidfile created : '/home/jacob/activeMq1/apache-activemq-5.5.1/data/activemq.pid' (pid '$APID')";
 exit $RET: No such file or directory    

Has any one run into this type of error before?

1
  • Worked on this a little more. I am able to run "java -jar run.jar start" from the bin file. Though I'm pretty sure that running run.jar by itself is not a best practice. Jun 27, 2012 at 17:34

4 Answers 4

18

Looks like I'm answering one of my questions again, but maybe this will help someone in the future.

steps.

  1. I ended up getting activemq to work by creating a configuration file via running the command "./bin/activemq setup newConfig" (exclude the quotes)
  2. I then replaced the current config file "activemq" which was located at etc/default/. (I made a backup of the original activemq file before overwriting it with newConfig).
  3. Run "./bin/activemq start" which will create a PID file.
  4. After the file is created re-run "./bin/activemq start" to finally start up the broker.

You can then test the install by navigating to "http://localhost:8161/admin/" or by doing a "netstat -an | grep 61616" if you kept the default ports etc.

3
  • 3
    When I tried the ubuntu package for ubuntu 12.04, I got into the same error you had and the steps did not solve it. However, when using the tar.gz version, yours steps worked flawlessly for solving this error
    – Thomas
    Apr 9, 2013 at 12:34
  • Thank you! I also used your steps to install ActiveMQ 5.8 on ubuntu 13.10.
    – Drew Wills
    May 6, 2014 at 18:01
  • Thank you, it helped us. We were automating the download and install of Activemq and service available using bash script and no matter how perfect our script was, when we tried to do vagrant up and it ran the script on the newly created instance, the activemq wouldn't start until we went and put in the command manually. And thanks to this post we realised why. Jul 16, 2014 at 4:33
13

I install activemq 5.13 on Debian, download and unzip in /opt, then I go to /opt/apache-activemq-5.13.1/run "./bin/activemq start", then appear this error:

xx@debian:/opt/apache-activemq-5.13.1$ ./bin/activemq start
INFO: Loading '/etc/default/activemq'
INFO: Using java '/usr/bin/java'
INFO: Starting - inspect logfiles specified in logging.properties and log4j.properties to get details
./bin/activemq: 330: ./bin/activemq: "/usr/bin/java"  -Djava.util.logging.config.file=logging.properties -Djava.security.auth.login.config=/opt/apache-activemq-5.13.1//conf/login.config   -Djava.awt.headless=true -Djava.io.tmpdir="/opt/apache-activemq-5.13.1//tmp"                -Dactivemq.classpath="/opt/apache-activemq-5.13.1//conf:/opt/apache-activemq-5.13.1//../lib/:"               -Dactivemq.home="/opt/apache-activemq-5.13.1/"               -Dactivemq.base="/opt/apache-activemq-5.13.1/"               -Dactivemq.conf="/opt/apache-activemq-5.13.1//conf"               -Dactivemq.data="/opt/apache-activemq-5.13.1//data"                              -jar "/opt/apache-activemq-5.13.1//bin/activemq.jar" start >/dev/null 2>&1 &
          RET="$?"; APID="$!";
          echo $APID > /opt/apache-activemq-5.13.1//data/activemq.pid;
          echo "INFO: pidfile created : '/opt/apache-activemq-5.13.1//data/activemq.pid' (pid '$APID')";exit $RET: not found

What I did is to check the Debian version using "uname -a":

Linux debian 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt20-1+deb8u3 (2016-01-17) x86_64 GNU/Linux

I found my debian is 64 bit system. so I run

./bin/linux-x86-64/activemq start

It shows:

Starting ActiveMQ Broker...

Then I can access the site:http://localhost:8161/admin/ with username "admin" and password "admin"

1
  • Thank you. It helped me
    – DIBits
    Feb 15, 2019 at 11:13
9

with Ubuntu 14.04, I had to create a link in /etc/activemq/instances-enabled

sudo ln -s ../instances-available/main/

similar to apache2 setup

then started the server with /etc/init.d/activemq start

1
  • in ubuntu 18.04 it works with below command sudo /etc/init.d/activemq start Jan 4, 2019 at 10:44
4

sudo is necessary.

bin$ sudo ./activemq start

bin$ sudo ./activemq status INFO: Loading '/opt/runtime/apache-activemq-5.11.1/bin/env' INFO: Using java '/usr/bin/java' ActiveMQ is running (pid '29887')

2
  • You must start the script as root if you have /etc/default/activemq that defines ACTIVEMQ_USER. So indeed, either use sudo or remove /etc/default/activemq.
    – laurent
    Jan 25, 2019 at 16:55
  • Got exactly same problem, when user=activemq was at active-mq.service. Replaced it to root, and everything starts now. Thank you. May 14, 2021 at 10:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.