11

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?

Kara
  • 6,115
  • 16
  • 50
  • 57
OrwellHindenberg
  • 4,988
  • 8
  • 38
  • 58
  • 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. – OrwellHindenberg Jun 27 '12 at 17:34

4 Answers4

17

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.

OrwellHindenberg
  • 4,988
  • 8
  • 38
  • 58
  • 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 09 '13 at 12:34
  • Thank you! I also used your steps to install ActiveMQ 5.8 on ubuntu 13.10. – Drew Wills May 06 '14 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. – Venu Murthy Jul 16 '14 at 04: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"

Pingjiang Li
  • 727
  • 1
  • 12
  • 27
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

Bob
  • 780
  • 9
  • 10
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')

  • 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 '19 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. – Andrey Kusnetsov May 14 '21 at 10:27