Question

I fallowed the exact steps in [1] in order to setup multiple ActiveMQ brokers in the same server. 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.

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

INFO | Apache ActiveMQ 5.9.0 (instance1, ID:udara-54224-1391513355578-0:1) is shutdown INFO | Closing org.apache.activemq.xbean.XBeanBrokerFactory$1@33e228bc: startup date [Tue Feb 04 06:29:14 EST 2014]; root of context hierarchy 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]; 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.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1608)

Was it helpful?

Solution

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? In which case your config for instance2 is wrong. Do a file search in the instance2/conf/ folder for any references to instance1, that should hopefully show you where the error is

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top