4

我有一台 Ubuntu 机器 12.04 版本。

我使用以下命令安装activemq

#sudo apt-get install activemq

默认情况下,apt-get 仅activemq 5.5在端口 61616 上安装核心服务。

现在我想要端口 8161 上的码头管理控制台。

我试图复制jetty.xml/etc/activemq/instances-available/main/ 并将导入添加到activemq.xml.

然后当我activemq在控制台模式下运行时出现以下错误

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

如何解决这个问题?谢谢先进。

4

2 回答 2

10

目前 Debian/Ubuntu ActiveMQ 软件包是“不完整的”。

摘自/usr/share/doc/libactivemq-java/README.Debian

禁用的功能
这个包不包含(还)上游提供的所有功能,因为 Debian 缺少一些依赖项。有关禁用模块的列表,您可以查看 /usr/share/doc/libactivemq-java/README.Debian

但是/usr/share/doc/libactivemq-java/README.Debian中没有禁用模块的列表。

要解决这些问题,请从以下网址下载 ActiveMQ 5.6 二进制 tar 存档:http ://activemq.apache.org/download.html 。

提取 tar 存档并将缺少的库/文件/目录复制到:/usr/share/activemq/

例如:

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

启用 ActiveMQ Jetty 配置并重新启动 ActiveMQ:

sudo service activemq restart
于 2013-08-13T16:22:36.313 回答
1

您需要添加额外的 JAR 文件(例如 jetty jars)。究竟是哪个,我不知道(它可能会因版本而异,而且你会弄得一团糟,让安装保持最新状态)。

我真的更喜欢下载发行版并解压缩它。这样你就有了一个更新鲜的版本以及控制台等。如果需要,设置为自动启动服务非常简单。我在实时环境(即 ubuntu)中使用了这种方法。

如果您想使用该软件包,我建议坚持使用其中的内容并使用其他工具(如 HermesJMS)并连接到它以进行管理/测试。

于 2013-01-01T12:21:28.333 回答