Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install or config activemq admin cosole(jetty) use apt-get command?

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.

like image 593
Yu Jiaao Avatar asked Dec 20 '22 11:12

Yu Jiaao


2 Answers

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
like image 112
jpoppe Avatar answered Dec 23 '22 00:12

jpoppe


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.

like image 32
Petter Nordlander Avatar answered Dec 23 '22 00:12

Petter Nordlander