ActiveMQ啟動報錯:java.lang.IllegalStateException: LifecycleProcessor not initialized
阿新 • • 發佈:2019-02-06
一、問題描述
一啟動ActiveMQ就報錯:
ERROR: java.lang.RuntimeException: Failed to execute start task. Reason: java.lang.IllegalStateException: BeanFactory not initialized or already closed - call 'refresh' before accessing beans via the ApplicationContext jvm 1 | java.lang.RuntimeException: Failed to execute start task. Reason: java.lang.IllegalStateException: BeanFactory not initialized or already closed - call 'refresh' before accessing beans via the ApplicationContext jvm 1 | at org.apache.activemq.console.command.StartCommand.runTask(StartCommand.java:91) jvm 1 | at org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:63) jvm 1 | at org.apache.activemq.console.command.ShellCommand.runTask(ShellCommand.java:154) jvm 1 | at org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:63) jvm 1 | at org.apache.activemq.console.command.ShellCommand.main(ShellCommand.java:104) jvm 1 | at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) jvm 1 | at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) jvm 1 | at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) jvm 1 | at java.lang.reflect.Method.invoke(Method.java:498) jvm 1 | at org.apache.activemq.console.Main.runTaskClass(Main.java:262) jvm 1 | at org.apache.activemq.console.Main.main(Main.java:115) jvm 1 | at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) jvm 1 | at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) jvm 1 | at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) jvm 1 | at java.lang.reflect.Method.invoke(Method.java:498) jvm 1 | at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) jvm 1 | at java.lang.Thread.run(Thread.java:748) jvm 1 | Caused by: java.lang.IllegalStateException: BeanFactory not initialized or already closed - call 'refresh' before accessing beans via the ApplicationContext jvm 1 | at org.springframework.context.support.AbstractRefreshableApplicationContext.getBeanFactory(AbstractRefreshableApplicationContext.java:170) jvm 1 | at org.springframework.context.support.AbstractApplicationContext.destroyBeans(AbstractApplicationContext.java:1030) jvm 1 | at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:556) jvm 1 | at org.apache.xbean.spring.context.ResourceXmlApplicationContext.<init>(ResourceXmlApplicationContext.java:64) jvm 1 | at org.apache.xbean.spring.context.ResourceXmlApplicationContext.<init>(ResourceXmlApplicationContext.java:52) jvm 1 | at org.apache.activemq.xbean.XBeanBrokerFactory$1.<init>(XBeanBrokerFactory.java:104) jvm 1 | at org.apache.activemq.xbean.XBeanBrokerFactory.createApplicationContext(XBeanBrokerFactory.java:104) jvm 1 | at org.apache.activemq.xbean.XBeanBrokerFactory.createBroker(XBeanBrokerFactory.java:67) jvm 1 | at org.apache.activemq.broker.BrokerFactory.createBroker(BrokerFactory.java:71) jvm 1 | at org.apache.activemq.broker.BrokerFactory.createBroker(BrokerFactory.java:54) jvm 1 | at org.apache.activemq.console.command.StartCommand.runTask(StartCommand.java:87) jvm 1 | ... 16 more jvm 1 | ERROR: java.lang.IllegalStateException: BeanFactory not initialized or already closed - call 'refresh' before accessing beans via the ApplicationContext jvm 1 | java.lang.IllegalStateException: BeanFactory not initialized or already closed - call 'refresh' before accessing beans via the ApplicationContext jvm 1 | at org.springframework.context.support.AbstractRefreshableApplicationContext.getBeanFactory(AbstractRefreshableApplicationContext.java:170) jvm 1 | at org.springframework.context.support.AbstractApplicationContext.destroyBeans(AbstractApplicationContext.java:1030) jvm 1 | at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:556) jvm 1 | at org.apache.xbean.spring.context.ResourceXmlApplicationContext.<init>(ResourceXmlApplicationContext.java:64) jvm 1 | at org.apache.xbean.spring.context.ResourceXmlApplicationContext.<init>(ResourceXmlApplicationContext.java:52) jvm 1 | at org.apache.activemq.xbean.XBeanBrokerFactory$1.<init>(XBeanBrokerFactory.java:104) jvm 1 | at org.apache.activemq.xbean.XBeanBrokerFactory.createApplicationContext(XBeanBrokerFactory.java:104) jvm 1 | at org.apache.activemq.xbean.XBeanBrokerFactory.createBroker(XBeanBrokerFactory.java:67) jvm 1 | at org.apache.activemq.broker.BrokerFactory.createBroker(BrokerFactory.java:71) jvm 1 | at org.apache.activemq.broker.BrokerFactory.createBroker(BrokerFactory.java:54) jvm 1 | at org.apache.activemq.console.command.StartCommand.runTask(StartCommand.java:87) jvm 1 | at org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:63) jvm 1 | at org.apache.activemq.console.command.ShellCommand.runTask(ShellCommand.java:154) jvm 1 | at org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:63) jvm 1 | at org.apache.activemq.console.command.ShellCommand.main(ShellCommand.java:104) jvm 1 | at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) jvm 1 | at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) jvm 1 | at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) jvm 1 | at java.lang.reflect.Method.invoke(Method.java:498) jvm 1 | at org.apache.activemq.console.Main.runTaskClass(Main.java:262) jvm 1 | at org.apache.activemq.console.Main.main(Main.java:115) jvm 1 | at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) jvm 1 | at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) jvm 1 | at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) jvm 1 | at java.lang.reflect.Method.invoke(Method.java:498) jvm 1 | at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) jvm 1 | at java.lang.Thread.run(Thread.java:748) wrapper | <-- Wrapper Stopped
二、解決方法
檢視data目錄下的日誌
發現一個關鍵字: JVM_Bind
java.io.IOException: Transport Connector could not be registered in JMX: java.io.IOException: Failed to bind to server socket: amqp://0.0.0.0:5672?maximumConnections=1000&wireFormat.maxFrameSize=104857600 due to: java.net.BindException: Address already in use: JVM_Bind
埠衝突。。然後通過TCPVIEW關閉該程序就行了。