4

I have a Ubuntu machine 12.04 version.

I use the following command to install the activemq:

#sudo apt-get install activemq

By the default apt-get only install activemq 5.5 core service on port 61616.

Now I want the jetty admin console on port 8161.

I've tried to copy the jetty.xml to /etc/activemq/instances-available/main/ and add the import to activemq.xml.

Then the following error came when I run activemq in console mode

ERROR: java.lang.Exception: org.springframework.beans.factory.BeanDefinitionStoreException: Failed to load type: org.eclipse.jetty.security.HashLoginService. Reason: java.lang.ClassNotFoundException: org.eclipse.jetty.security.HashLoginService; nested exception is java.lang.ClassNotFoundException: org.eclipse.jetty.security.HashLoginService
java.lang.Exception: org.springframework.beans.factory.BeanDefinitionStoreException: Failed to load type: org.eclipse.jetty.security.HashLoginService. Reason: java.lang.ClassNotFoundException: org.eclipse.jetty.security.HashLoginService; nested exception is java.lang.ClassNotFoundException: org.eclipse.jetty.security.HashLoginService
    at org.apache.activemq.console.command.StartCommand.runTask(StartCommand.java:99)
    at org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:57)
    at org.apache.activemq.console.command.ShellCommand.runTask(ShellCommand.java:143)
    at org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:57)
    at org.apache.activemq.console.command.ShellCommand.main(ShellCommand.java:85)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:616)
    at org.apache.activemq.console.Main.runTaskClass(Main.java:251)
    at org.apache.activemq.console.Main.main(Main.java:107)
Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Failed to load type: org.eclipse.jetty.security.HashLoginService. Reason: java.lang.ClassNotFoundException: org.eclipse.jetty.security.HashLoginService; nested exception is java.lang.ClassNotFoundException: org.eclipse.jetty.security.HashLoginService
    at org.apache.xbean.spring.context.v2c.XBeanQNameHelper.getBeanInfo(XBeanQNameHelper.java:75)
    at org.apache.xbean.spring.context.v2c.XBeanQNameHelper.coerceNamespaceAwarePropertyValues(XBeanQNameHelper.java:54)
    at org.apache.xbean.spring.context.v2c.XBeanBeanDefinitionParserDelegate.parseBeanDefinitionElement(XBeanBeanDefinitionParserDelegate.java:59)
    at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseBeanDefinitionElement(BeanDefinitionParserDelegate.java:396)
    at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseBeanDefinitionElement(BeanDefinitionParserDelegate.java:365)
    at org.apache.xbean.spring.context.v2.XBeanBeanDefinitionDocumentReader.processBeanDefinition(XBeanBeanDefinitionDocumentReader.java:174)
    at org.apache.xbean.spring.context.v2.XBeanBeanDefinitionDocumentReader.parseDefaultElement(XBeanBeanDefinitionDocumentReader.java:101)
    at org.apache.xbean.spring.context.v2.XBeanBeanDefinitionDocumentReader.parseBeanDefinitions(XBeanBeanDefinitionDocumentReader.java:81)
    at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:93)
    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:493)
    at org.apache.xbean.spring.context.v2.XBeanXmlBeanDefinitionReader.registerBeanDefinitions(XBeanXmlBeanDefinitionReader.java:79)
    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:390)
    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)
    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)
    at org.apache.xbean.spring.context.v2.XBeanBeanDefinitionDocumentReader.importBeanDefinitionResource(XBeanBeanDefinitionDocumentReader.java:129)
    at org.apache.xbean.spring.context.v2.XBeanBeanDefinitionDocumentReader.parseDefaultElement(XBeanBeanDefinitionDocumentReader.java:95)
    at org.apache.xbean.spring.context.v2.XBeanBeanDefinitionDocumentReader.parseBeanDefinitions(XBeanBeanDefinitionDocumentReader.java:81)
    at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:93)
    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:493)
    at org.apache.xbean.spring.context.v2.XBeanXmlBeanDefinitionReader.registerBeanDefinitions(XBeanXmlBeanDefinitionReader.java:79)
    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:390)
    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)
    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)
    at org.apache.xbean.spring.context.ResourceXmlApplicationContext.loadBeanDefinitions(ResourceXmlApplicationContext.java:111)
    at org.apache.xbean.spring.context.ResourceXmlApplicationContext.loadBeanDefinitions(ResourceXmlApplicationContext.java:104)
    at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:130)
    at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:467)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:397)
    at org.apache.xbean.spring.context.ResourceXmlApplicationContext.<init>(ResourceXmlApplicationContext.java:64)
    at org.apache.xbean.spring.context.ResourceXmlApplicationContext.<init>(ResourceXmlApplicationContext.java:52)
    at org.apache.activemq.xbean.XBeanBrokerFactory$1.<init>(XBeanBrokerFactory.java:114)
    at org.apache.activemq.xbean.XBeanBrokerFactory.createApplicationContext(XBeanBrokerFactory.java:114)
    at org.apache.activemq.xbean.XBeanBrokerFactory.createBroker(XBeanBrokerFactory.java:70)
    at org.apache.activemq.broker.BrokerFactory.createBroker(BrokerFactory.java:71)
    at org.apache.activemq.broker.BrokerFactory.createBroker(BrokerFactory.java:54)
    at org.apache.activemq.console.command.StartCommand.startBroker(StartCommand.java:115)
    at org.apache.activemq.console.command.StartCommand.runTask(StartCommand.java:91)
    ... 10 more
Caused by: java.lang.ClassNotFoundException: org.eclipse.jetty.security.HashLoginService
    at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
    at org.apache.xbean.spring.context.v2c.XBeanQNameHelper.loadClass(XBeanQNameHelper.java:107)
    at org.apache.xbean.spring.context.v2c.XBeanQNameHelper.getBeanInfo(XBeanQNameHelper.java:72)
    ... 46 more

How to FIX this? Thanks advanced.

Arpit
  • 6,212
  • 8
  • 38
  • 69
Yu Jiaao
  • 4,444
  • 5
  • 44
  • 57
  • how did you manage to go this far with the ubuntu packaged version? I got stopped in the error mentioned [here](http://stackoverflow.com/questions/11231640/activemq-will-not-start-on-my-ubuntu-vm) – Thomas Apr 09 '13 at 12:36

2 Answers2

10

Currently the Debian/Ubuntu ActiveMQ packages are 'incomplete'.

Excerpt from /usr/share/doc/libactivemq-java/README.Debian:

Disabled features
This package doesn't contains (yet) all features provided by upstream as some dependencies are missing from Debian. For a list of disabled modules, you can look at /usr/share/doc/libactivemq-java/README.Debian

But there is no list of disabled modules in /usr/share/doc/libactivemq-java/README.Debian.

To solve the issues download the ActiveMQ 5.6 binary tar archive from: http://activemq.apache.org/download.html.

Extract the tar archive and copy the missing libraries/files/directories to: /usr/share/activemq/.

For example:

cd /tmp
wget http://apache.proserve.nl/activemq/apache-activemq/5.6.0/apache-activemq-5.6.0-bin.tar.gz
tar zxvf apache-activemq-5.6.0-bin.tar.gz
cd apache-activemq-5.6.0/lib
rm activemq-console-5.6.0.jar activemq-core-5.6.0.jar activemq-jaas-5.6.0.jar activemq-protobuf-1.1.jar activemq-rar.txt kahadb-5.6.0.jar slf4j-api-1.6.4.jar jcl-over-slf4j-1.6.4.jar
cd -
sudo cp -r apache-activemq-5.6.0/lib/* /usr/share/activemq/lib
sudo cp -r apache-activemq-5.6.0/webapps /usr/share/activemq

Enable the ActiveMQ Jetty configuration and restart ActiveMQ:

sudo service activemq restart
jpoppe
  • 2,228
  • 24
  • 25
  • Thanks, your answer is usefull, use the service way is more convernient when system rebooted. – Yu Jiaao Sep 18 '13 at 15:58
  • 2
    My experience was that the apt sourced package was...to put it mildly, fundamentally fsck'ed. After replacing all libs with those downloaded in the tar ball, and throwing in the entire jetty7 lib folder to boot, I finally started to get some joy. Still not working 100% though, but I would strongly advise anybody needing activemq on ubuntu 12.04 to just go with the activemq tar ball. – demaniak Dec 05 '13 at 15:13
  • 2
    This is still the case as of Ubuntu 14.04. You're much better off downloading the distribution from apache.org. – deyur Sep 02 '15 at 03:14
  • 1
    This is still the case: Ubuntu 16.04.2 LTS. Unfortunately, there is no `activemq-all` package. – Sergey Vyacheslavovich Brunov Aug 23 '17 at 11:21
1

You need to add additional JAR files (jetty jars for instance). Exactly which, I don't know (it probably varies between versions and you will have a mess keeping the installation up to date).

I really prefer to download the distribution and just unzip it. That way you have a way fresher release as well as the console etc. It's pretty straight forward to set up as a auto starting service if desired. I've used this approach in live environments (ubuntu that is).

If you want to go with the package, I suggest stick to what's in there and use another tool (like HermesJMS) and connect to it for administration/testing.

Petter Nordlander
  • 22,053
  • 5
  • 50
  • 84