amq-broker无法在ServiceMix中启动

时间:2017-06-21 20:34:43

标签: activemq apache-servicemix

启动ServiceMix时,我在启动时收到此错误。

2017-06-21 16:24:51,647 | ERROR | ctivemq.server]) | configadmin                      | 3 - org.apache.felix.configadmin - 1.8.12 | [org.osgi.service.cm.ManagedServiceFactory, id=188, bundle=25/mvn:org.apache.activemq/activemq-osgi/5.14.3]: Updating configuration org.apache.activemq.server.598341f8-41a8-446f-b9f2-0de589a8a14c caused a problem: Cannot start the broker
org.osgi.service.cm.ConfigurationException: null : Cannot start the broker
        at org.apache.activemq.osgi.ActiveMQServiceFactory.updated(ActiveMQServiceFactory.java:144)[25:org.apache.activemq.activemq-osgi:5.14.3]
        at org.apache.felix.cm.impl.helper.ManagedServiceFactoryTracker.updated(ManagedServiceFactoryTracker.java:159)[3:org.apache.felix.configadmin:1.8.12]
        at org.apache.felix.cm.impl.helper.ManagedServiceFactoryTracker.provideConfiguration(ManagedServiceFactoryTracker.java:93)[3:org.apache.felix.configadmin:1.8.12]
        at org.apache.felix.cm.impl.ConfigurationManager$ManagedServiceFactoryUpdate.provide(ConfigurationManager.java:1620)[3:org.apache.felix.configadmin:1.8.12]
        at org.apache.felix.cm.impl.ConfigurationManager$ManagedServiceFactoryUpdate.run(ConfigurationManager.java:1563)[3:org.apache.felix.configadmin:1.8.12]
        at org.apache.felix.cm.impl.UpdateThread.run0(UpdateThread.java:141)[3:org.apache.felix.configadmin:1.8.12]
        at org.apache.felix.cm.impl.UpdateThread.run(UpdateThread.java:109)[3:org.apache.felix.configadmin:1.8.12]
        at java.lang.Thread.run(Thread.java:745)[:1.8.0_121]
Caused by: javax.management.InstanceAlreadyExistsException: org.apache.activemq:type=Broker,brokerName=amq-broker
        at com.sun.jmx.mbeanserver.Repository.addMBean(Repository.java:437)[:1.8.0_121]
        at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerWithRepository(DefaultMBeanServerInterceptor.java:1898)[:1.8.0_121]
        at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerDynamicMBean(DefaultMBeanServerInterceptor.java:966)[:1.8.0_121]
        at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerObject(DefaultMBeanServerInterceptor.java:900)[:1.8.0_121]
        at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerMBean(DefaultMBeanServerInterceptor.java:324)[:1.8.0_121]
        at com.sun.jmx.mbeanserver.JmxMBeanServer.registerMBean(JmxMBeanServer.java:522)[:1.8.0_121]
        at org.apache.activemq.broker.jmx.ManagementContext.registerMBean(ManagementContext.java:408)[25:org.apache.activemq.activemq-osgi:5.14.3]
        at org.apache.activemq.broker.jmx.AnnotatedMBean.registerMBean(AnnotatedMBean.java:72)[25:org.apache.activemq.activemq-osgi:5.14.3]
        at org.apache.activemq.broker.BrokerService.startManagementContext(BrokerService.java:2584)[25:org.apache.activemq.activemq-osgi:5.14.3]
        at org.apache.activemq.broker.BrokerService.start(BrokerService.java:608)[25:org.apache.activemq.activemq-osgi:5.14.3]
        at org.apache.activemq.osgi.ActiveMQServiceFactory.updated(ActiveMQServiceFactory.java:140)[25:org.apache.activemq.activemq-osgi:5.14.3]

没有任何部署到它,到目前为止唯一的变化是已经安装了camel-http4,camel-jetty9和camel-mongodb功能。

可能导致此问题的原因以及如何解决?

1 个答案:

答案 0 :(得分:1)

我已经找到了原因。 ServiceMix已启动,已安装,停止,压缩,发送到新计算机,并在其他目录中解压缩。

通过删除以下文件夹

解决了该问题
apache-servicemix-7.0.0\data\cache\bundle3\data\config\org\apache\activemq\server

其中包含在移动服务器后不再有效的ActiveMQ配置信息。

其他系统似乎也受此影响。修复它的正确方法似乎是在karaf离线时删除数据目录,或者使用clean标志启动karaf。 (注意,这将擦除基本版本中的所有更改)

我已经开始使用karaf-maven-plugin来预先设置服务器,并且只安装我实际使用的servicemix组件。