简体   繁体   English

在同一台计算机上设置多个ActiveMQ代理时出错

[英]Error when setting multiple ActiveMQ brokers in same machine

I fallowed the exact steps in [1] in order to setup multiple ActiveMQ brokers in the same server. 我放弃[1]中的确切步骤,以便在同一服务器上设置多个ActiveMQ代理。 When I start the second instance I always get the same error. 当我启动第二个实例时,我总是会遇到相同的错误。

One thing I noticed is configurations on both instances are same. 我注意到的一件事是两个实例上的配置都相同。 for instance configurations like port s are same in both activemq.xml and jetty.xml. 例如activemq.xml和jetty.xml中的port之类的配置都是相同的。

I even change the ports of the second instance so it won't get crashed with the first intance. 我什至更改了第二个实例的端口,因此它不会因第一个实例而崩溃。 But I get the same Exception. 但是我得到同样的异常。

https://sbforge.org/display/BITMAG/Running+multiple+activemq+instances+on+the+same+server https://sbforge.org/display/BITMAG/Running+multiple+activemq+instances+on+the+same+server

INFO | 信息| Apache ActiveMQ 5.9.0 (instance1, ID:udara-54224-1391513355578-0:1) is shutdown INFO | Apache ActiveMQ 5.9.0(实例1,ID:udara-54224-1391513355578-0:1)已关闭 Closing org.apache.activemq.xbean.XBeanBrokerFactory$1@33e228bc: startup date [Tue Feb 04 06:29:14 EST 2014]; 关闭org.apache.activemq.xbean.XBeanBrokerFactory$1@33e228bc:启动日期[2014年2月4日星期二06:29:14 EST]; root of context hierarchy WARN | 上下文层次结构的根WARN | Exception thrown from LifecycleProcessor on context close java.lang.IllegalStateException: LifecycleProcessor not initialized - call 'refresh' before invoking lifecycle methods via the context: org.apache.activemq.xbean.XBeanBrokerFactory$1@33e228bc: startup date [Tue Feb 04 06:29:14 EST 2014]; 从LifecycleProcessor在上下文关闭时抛出异常java.lang.IllegalStateException: LifecycleProcessor未初始化-在通过上下文调用生命周期方法之前调用“刷新”: org.apache.activemq.xbean.XBeanBrokerFactory$1@33e228bc:启动日期[2月4日,星期二: 2014年EST 29:14]; root of context hierarchy at org.springframework.context.support.AbstractApplicationContext.getLifecycleProcessor(AbstractApplicationContext.java:360) at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:1057) at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:1010) at org.apache.activemq.hooks.SpringContextHook.run(SpringContextHook.java:30) at org.apache.activemq.broker.BrokerService.stop(BrokerService.java:782) at org.apache.activemq.xbean.XBeanBrokerService.stop(XBeanBrokerService.java:122) at org.apache.activemq.broker.BrokerService.start(BrokerService.java:574) at org.apache.activemq.xbean.XBeanBrokerService.afterPropertiesSet(XBeanBrokerService.java:73) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.j 上下文层次结构的根位于org.springframework.context.support的org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:1057)的org.springframework.context.support.AbstractApplicationContext.getLifecycleProcessor(AbstractApplicationContext.java:360)位于org.apache.activemq.hooks.SpringContextHook.run(SpringContextHook.java:30)的.AbstractApplicationContext.close(AbstractApplicationContext.java:1010),位于org.apache.activemq.broker.BrokerService.stop(BrokerService.java:782)的位于org.apache.activemq.broker.BrokerService.start(BrokerService.java:574)的org.apache.activemq.xbean.XBeanBrokerService.stop(XBeanBrokerService.java:122)在org.apache.activemq.xbean.XBeanBrokerService.afterPropertiesSet( XBeanBrokerService.java:73)位于sun.reflect.NativeMethodAccessorImpl.invoke0(本地方法)位于sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)位于sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.j ava:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1608) ava:25),位于org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1608)的java.lang.reflect.Method.invoke(Method.java:597)

According to those instructions, you definitely need to change the ports for each instance 根据这些说明,您绝对需要为每个实例更改端口

each instance had its port numbers in <instance>/conf/activemq.xml and conf/jetty.xml edited, so instance1 listens on port 60001 and is managed on port 8001, instance2 on 60002 and 8002, instance3 on 60003 and 8003

That stack trace that you printed is a WARN and not an ERROR - does it not still work anyway? 您打印的堆栈跟踪是警告,而不是错误-仍然无法正常工作吗? The log you printed is for instance1 - are you trying to start instance2? 您打印的日志是用于instance1的-您是否尝试启动instance2? In which case your config for instance2 is wrong. 在这种情况下,您的instance2配置错误。 Do a file search in the instance2/conf/ folder for any references to instance1, that should hopefully show you where the error is 在instance2 / conf /文件夹中进行文件搜索,以查找对instance1的任何引用,从而有望向您显示错误的位置

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM