我的系统是win8.1(64位的)下面是我用命令行打开bin\win64\activemq.bat时的报错,
wrapper | --> Wrapper Started as Console
wrapper | Launching a JVM...
jvm 1 | Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.org
jvm 1 | Copyright 1999-2006 Tanuki Software, Inc. All Rights Reserved.
jvm 1 |
jvm 1 | Java Runtime: Oracle Corporation 1.7.0_17 C:\Program Files\Java\jre7
jvm 1 | Heap sizes: current=15872k free=11553k max=1013632k
jvm 1 | JVM args: -Dactivemq.home=../.. -Dactivemq.base=../.. -Djavax.net
.ssl.keyStorePassword=password -Djavax.net.ssl.trustStorePassword=password -Djav
ax.net.ssl.keyStore=../../conf/broker.ks -Djavax.net.ssl.trustStore=../../conf/b
roker.ts -Dcom.sun.management.jmxremote -Dorg.apache.activemq.UseDedicatedTaskRu
nner=true -Djava.util.logging.config.file=logging.properties -Dactivemq.conf=../
../conf -Dactivemq.data=../../data -Djava.security.auth.login.config=../../conf/
login.config -Xmx1024m -Djava.library.path=../../bin/win32 -Dwrapper.key=jW9ZpPT
P06mL7EMf -Dwrapper.port=32000 -Dwrapper.jvm.port.min=31000 -Dwrapper.jvm.port.m
ax=31999 -Dwrapper.pid=5044 -Dwrapper.version=3.2.3 -Dwrapper.native_library=wra
pper -Dwrapper.cpu.timeout=10 -Dwrapper.jvmid=1
jvm 1 | Extensions classpath:
jvm 1 | [..\..\lib,..\..\lib\camel,..\..\lib\optional,..\..\lib\web,..\..\l
ib\extra]
jvm 1 | ACTIVEMQ_HOME: ..\..
jvm 1 | ACTIVEMQ_BASE: ..\..
jvm 1 | ACTIVEMQ_CONF: ..\..\conf
jvm 1 | ACTIVEMQ_DATA: ..\..\data
jvm 1 | Loading message broker from: xbean:activemq.xml
jvm 1 | INFO | Refreshing [email protected]
9377: startup date [Fri Jun 26 11:32:02 CST 2015]; root of context hierarchy
jvm 1 | INFO | PListStore:[E:\Tendyron工作备份\IM\apache-activemq-5.10.2-bin
\apache-activemq-5.10.2\bin\win32\..\..\data\localhost\tmp_storage] started
jvm 1 | INFO | Using Persistence Adapter: KahaDBPersistenceAdapter[E:\Tendyr
on工作备份\IM\apache-activemq-5.10.2-bin\apache-activemq-5.10.2\bin\win32\..\..data\kahadb]
jvm 1 | INFO | KahaDB is version 5
jvm 1 | INFO | Recovering from the journal ...
jvm 1 | INFO | Recovery replayed 1 operations from the journal in 0.024 seco
nds.
jvm 1 | INFO | Apache ActiveMQ 5.10.2 (localhost, ID:PCbqcui-55122-143528952
4042-0:1) is starting
jvm 1 | ERROR | Failed to start Apache ActiveMQ ([localhost, ID:PCbqcui-55122
-1435289524042-0:1], java.io.IOException: Transport Connector could not be regis
tered in JMX: Failed to bind to server socket: tcp://0.0.0.0:61616?maximumConnec
tions=1000&wireFormat.maxFrameSize=104857600 due to: java.net.BindException: Add
ress already in use: JVM_Bind)
jvm 1 | INFO | Apache ActiveMQ 5.10.2 (localhost, ID:PCbqcui-55122-143528952
4042-0:1) is shutting down
jvm 1 | INFO | Connector openwire stopped
jvm 1 | INFO | Connector amqp stopped
jvm 1 | INFO | Connector stomp stopped
jvm 1 | INFO | Connector mqtt stopped
jvm 1 | INFO | Connector ws stopped
jvm 1 | INFO | PListStore:[E:\Tendyron工作备份\IM\apache-activemq-5.10.2-bin
\apache-activemq-5.10.2\bin\win32\..\..\data\localhost\tmp_storage] stopped
jvm 1 | INFO | Stopping async queue tasks
jvm 1 | INFO | Stopping async topic tasks
jvm 1 | INFO | Stopped KahaDB
jvm 1 | INFO | Apache ActiveMQ 5.10.2 (localhost, ID:PCbqcui-55122-143528952
4042-0:1) uptime 1.284 seconds
jvm 1 | INFO | Apache ActiveMQ 5.10.2 (localhost, ID:PCbqcui-55122-143528952
4042-0:1) is shutdown
jvm 1 | INFO | Closing org.apache.activemq.xbean.XBeanBrokerFactory$1@19f937
7: startup date [Fri Jun 26 11:32:02 CST 2015]; root of context hierarchy
jvm 1 | WARN | Exception thrown from LifecycleProcessor on context close
jvm 1 | java.lang.IllegalStateException: LifecycleProcessor not initialized -
call ‘refresh‘ before invoking lifecycle methods via the context: org.apache.ac
tivemq.xbean.XBeanBrokerFactory$1@19f9377: startup date [Fri Jun 26 11:32:02 CST
2015]; root of context hierarchy
jvm 1 | at org.springframework.context.support.AbstractApplicationContex
t.getLifecycleProcessor(AbstractApplicationContext.java:360)[spring-context-3.2.
8.RELEASE.jar:3.2.8.RELEASE]
jvm 1 | at org.springframework.context.support.AbstractApplicationContex
t.doClose(AbstractApplicationContext.java:1057)[spring-context-3.2.8.RELEASE.jar
:3.2.8.RELEASE]
jvm 1 | at org.springframework.context.support.AbstractApplicationContex
t.close(AbstractApplicationContext.java:1010)[spring-context-3.2.8.RELEASE.jar:3
.2.8.RELEASE]
jvm 1 | at org.apache.activemq.hooks.SpringContextHook.run(SpringContext
Hook.java:30)[activemq-spring-5.10.2.jar:5.10.2]
jvm 1 | at org.apache.activemq.broker.BrokerService.stop(BrokerService.j
ava:809)[activemq-broker-5.10.2.jar:5.10.2]
jvm 1 | at org.apache.activemq.xbean.XBeanBrokerService.stop(XBeanBroker
Service.java:122)[activemq-spring-5.10.2.jar:5.10.2]
jvm 1 | at org.apache.activemq.broker.BrokerService.start(BrokerService.
java:601)[activemq-broker-5.10.2.jar:5.10.2]
jvm 1 | at org.apache.activemq.xbean.XBeanBrokerService.afterPropertiesS
et(XBeanBrokerService.java:73)[activemq-spring-5.10.2.jar:5.10.2]
jvm 1 | at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:
1.7.0_17]
jvm 1 | at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)[:
1.7.0_17]
jvm 1 | at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Sourc
e)[:1.7.0_17]
jvm 1 | at java.lang.reflect.Method.invoke(Unknown Source)[:1.7.0_17]
jvm 1 | at org.springframework.beans.factory.support.AbstractAutowireCap
ableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1
638)[spring-beans-3.2.8.RELEASE.jar:3.2.8.RELEASE]
jvm 1 | at org.springframework.beans.factory.support.AbstractAutowireCap
ableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1579)[
spring-beans-3.2.8.RELEASE.jar:3.2.8.RELEASE]
jvm 1 | at org.springframework.beans.factory.support.AbstractAutowireCap
ableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1509)[spr
ing-beans-3.2.8.RELEASE.jar:3.2.8.RELEASE]
jvm 1 | at org.springframework.beans.factory.support.AbstractAutowireCap
ableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:521)[spring
-beans-3.2.8.RELEASE.jar:3.2.8.RELEASE]
jvm 1 | at org.springframework.beans.factory.support.AbstractAutowireCap
ableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)[spring-b
eans-3.2.8.RELEASE.jar:3.2.8.RELEASE]
jvm 1 | at org.springframework.beans.factory.support.AbstractBeanFactory
$1.getObject(AbstractBeanFactory.java:296)[spring-beans-3.2.8.RELEASE.jar:3.2.8.
RELEASE]
jvm 1 | at org.springframework.beans.factory.support.DefaultSingletonBea
nRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)[spring-beans-3.2.8
.RELEASE.jar:3.2.8.RELEASE]
jvm 1 | at org.springframework.beans.factory.support.AbstractBeanFactory
.doGetBean(AbstractBeanFactory.java:293)[spring-beans-3.2.8.RELEASE.jar:3.2.8.RE
LEASE]
jvm 1 | at org.springframework.beans.factory.support.AbstractBeanFactory
.getBean(AbstractBeanFactory.java:194)[spring-beans-3.2.8.RELEASE.jar:3.2.8.RELE
ASE]
jvm 1 | at org.springframework.beans.factory.support.DefaultListableBean
Factory.preInstantiateSingletons(DefaultListableBeanFactory.java:628)[spring-bea
ns-3.2.8.RELEASE.jar:3.2.8.RELEASE]
jvm 1 | at org.springframework.context.support.AbstractApplicationContex
t.finishBeanFactoryInitialization(AbstractApplicationContext.java:932)[spring-co
ntext-3.2.8.RELEASE.jar:3.2.8.RELEASE]
jvm 1 | at org.springframework.context.support.AbstractApplicationContex
t.refresh(AbstractApplicationContext.java:479)[spring-context-3.2.8.RELEASE.jar:
3.2.8.RELEASE]
jvm 1 | at org.apache.xbean.spring.context.ResourceXmlApplicationContext
.(ResourceXmlApplicationContext.java:64)[xbean-spring-3.16.jar:3.16]
jvm 1 | at org.apache.xbean.spring.context.ResourceXmlApplicationContext
.(ResourceXmlApplicationContext.java:52)[xbean-spring-3.16.jar:3.16]
jvm 1 | at org.apache.activemq.xbean.XBeanBrokerFactory$1.(XBeanBr
okerFactory.java:104)[activemq-spring-5.10.2.jar:5.10.2]
jvm 1 | at org.apache.activemq.xbean.XBeanBrokerFactory.createApplicatio
nContext(XBeanBrokerFactory.java:104)[activemq-spring-5.10.2.jar:5.10.2]
jvm 1 | at org.apache.activemq.xbean.XBeanBrokerFactory.createBroker(XBe
anBrokerFactory.java:67)[activemq-spring-5.10.2.jar:5.10.2]
jvm 1 | at org.apache.activemq.broker.BrokerFactory.createBroker(BrokerF
actory.java:71)[activemq-broker-5.10.2.jar:5.10.2]
jvm 1 | at org.apache.activemq.broker.BrokerFactory.createBroker(BrokerF
actory.java:54)[activemq-broker-5.10.2.jar:5.10.2]
jvm 1 | at org.apache.activemq.console.command.StartCommand.runTask(Star
tCommand.java:87)[activemq-console-5.10.2.jar:5.10.2]
jvm 1 | at org.apache.activemq.console.command.AbstractCommand.execute(A
bstractCommand.java:57)[activemq-console-5.10.2.jar:5.10.2]
jvm 1 | at org.apache.activemq.console.command.ShellCommand.runTask(Shel
lCommand.java:150)[activemq-console-5.10.2.jar:5.10.2]
jvm 1 | at org.apache.activemq.console.command.AbstractCommand.execute(A
bstractCommand.java:57)[activemq-console-5.10.2.jar:5.10.2]
jvm 1 | at org.apache.activemq.console.command.ShellCommand.main(ShellCo
mmand.java:104)[activemq-console-5.10.2.jar:5.10.2]
jvm 1 | at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:
1.7.0_17]
jvm 1 | at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)[:
1.7.0_17]
jvm 1 | at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Sourc
e)[:1.7.0_17]
jvm 1 | at java.lang.reflect.Method.invoke(Unknown Source)[:1.7.0_17]
jvm 1 | at org.apache.activemq.console.Main.runTaskClass(Main.java:262)[
activemq.jar:5.10.2]
jvm 1 | at org.apache.activemq.console.Main.main(Main.java:115)[activemq
.jar:5.10.2]
jvm 1 | at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:
1.7.0_17]
jvm 1 | at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)[:
1.7.0_17]
jvm 1 | at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Sourc
e)[:1.7.0_17]
jvm 1 | at java.lang.reflect.Method.invoke(Unknown Source)[:1.7.0_17]
jvm 1 | at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimple
App.java:240)[wrapper.jar:3.2.3]
jvm 1 | at java.lang.Thread.run(Unknown Source)[:1.7.0_17]
jvm 1 | ERROR: java.lang.RuntimeException: Failed to execute start task. Reas
on: java.lang.IllegalStateException: BeanFactory not initialized or already clos
ed - call ‘refresh‘ before accessing beans via the ApplicationContext
jvm 1 | java.lang.RuntimeException: Failed to execute start task. Reason: jav
a.lang.IllegalStateException: BeanFactory not initialized or already closed - ca
ll ‘refresh‘ before accessing beans via the ApplicationContext
jvm 1 | at org.apache.activemq.console.command.StartCommand.runTask(Star
tCommand.java:91)
jvm 1 | at org.apache.activemq.console.command.AbstractCommand.execute(A
bstractCommand.java:57)
jvm 1 | at org.apache.activemq.console.command.ShellCommand.runTask(Shel
lCommand.java:150)
jvm 1 | at org.apache.activemq.console.command.AbstractCommand.execute(A
bstractCommand.java:57)
jvm 1 | at org.apache.activemq.console.command.ShellCommand.main(ShellCo
mmand.java:104)
jvm 1 | at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
jvm 1 | at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
jvm 1 | at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Sourc
e)
jvm 1 | at java.lang.reflect.Method.invoke(Unknown Source)
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(Unknown Source)
jvm 1 | at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Sourc
e)
jvm 1 | at java.lang.reflect.Method.invoke(Unknown Source)
jvm 1 | at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimple
App.java:240)
jvm 1 | at java.lang.Thread.run(Unknown Source)
jvm 1 | Caused by: java.lang.IllegalStateException: BeanFactory not initializ
ed or already closed - call ‘refresh‘ before accessing beans via the Application
Context
jvm 1 | at org.springframework.context.support.AbstractRefreshableApplic
ationContext.getBeanFactory(AbstractRefreshableApplicationContext.java:171)
jvm 1 | at org.springframework.context.support.AbstractApplicationContex
t.destroyBeans(AbstractApplicationContext.java:1090)
jvm 1 | at org.springframework.context.support.AbstractApplicationContex
t.refresh(AbstractApplicationContext.java:487)
jvm 1 | at org.apache.xbean.spring.context.ResourceXmlApplicationContext
.(ResourceXmlApplicationContext.java:64)
jvm 1 | at org.apache.xbean.spring.context.ResourceXmlApplicationContext
.(ResourceXmlApplicationContext.java:52)
jvm 1 | at org.apache.activemq.xbean.XBeanBrokerFactory$1.(XBeanBr
okerFactory.java:104)
jvm 1 | at org.apache.activemq.xbean.XBeanBrokerFactory.createApplicatio
nContext(XBeanBrokerFactory.java:104)
jvm 1 | at org.apache.activemq.xbean.XBeanBrokerFactory.createBroker(XBe
anBrokerFactory.java:67)
jvm 1 | at org.apache.activemq.broker.BrokerFactory.createBroker(BrokerF
actory.java:71)
jvm 1 | at org.apache.activemq.broker.BrokerFactory.createBroker(BrokerF
actory.java:54)
jvm 1 | at org.apache.activemq.console.command.StartCommand.runTask(Star
tCommand.java:87)
jvm 1 | ... 16 more
jvm 1 | ERROR: java.lang.IllegalStateException: BeanFactory not initialized o
r already closed - call ‘refresh‘ before accessing beans via the ApplicationCont
ext
jvm 1 | java.lang.IllegalStateException: BeanFactory not initialized or alrea
dy closed - call ‘refresh‘ before accessing beans via the ApplicationContext
jvm 1 | at org.springframework.context.support.AbstractRefreshableApplic
ationContext.getBeanFactory(AbstractRefreshableApplicationContext.java:171)
jvm 1 | at org.springframework.context.support.AbstractApplicationContex
t.destroyBeans(AbstractApplicationContext.java:1090)
jvm 1 | at org.springframework.context.support.AbstractApplicationContex
t.refresh(AbstractApplicationContext.java:487)
jvm 1 | at org.apache.xbean.spring.context.ResourceXmlApplicationContext
.(ResourceXmlApplicationContext.java:64)
jvm 1 | at org.apache.xbean.spring.context.ResourceXmlApplicationContext
.(ResourceXmlApplicationContext.java:52)
jvm 1 | at org.apache.activemq.xbean.XBeanBrokerFactory$1.(XBeanBr
okerFactory.java:104)
jvm 1 | at org.apache.activemq.xbean.XBeanBrokerFactory.createApplicatio
nContext(XBeanBrokerFactory.java:104)
jvm 1 | at org.apache.activemq.xbean.XBeanBrokerFactory.createBroker(XBe
anBrokerFactory.java:67)
jvm 1 | at org.apache.activemq.broker.BrokerFactory.createBroker(BrokerF
actory.java:71)
jvm 1 | at org.apache.activemq.broker.BrokerFactory.createBroker(BrokerF
actory.java:54)
jvm 1 | at org.apache.activemq.console.command.StartCommand.runTask(Star
tCommand.java:87)
jvm 1 | at org.apache.activemq.console.command.AbstractCommand.execute(A
bstractCommand.java:57)
jvm 1 | at org.apache.activemq.console.command.ShellCommand.runTask(Shel
lCommand.java:150)
jvm 1 | at org.apache.activemq.console.command.AbstractCommand.execute(A
bstractCommand.java:57)
jvm 1 | at org.apache.activemq.console.command.ShellCommand.main(ShellCo
mmand.java:104)
jvm 1 | at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
jvm 1 | at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
jvm 1 | at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Sourc
e)
jvm 1 | at java.lang.reflect.Method.invoke(Unknown Source)
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(Unknown Source)
jvm 1 | at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Sourc
e)
jvm 1 | at java.lang.reflect.Method.invoke(Unknown Source)
jvm 1 | at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimple
App.java:240)
jvm 1 | at java.lang.Thread.run(Unknown Source)
wrapper | <-- Wrapper Stopped
在网上早了好多的解决办法,但都不行,我这个是5.13.2的,网上基本5.10的比较多,照着网上的办法,又是改计算机名——不能有中间横杆,又是改activemq.xml的,我试了试,还是不能正常启动。试了好久后,又觉得是jdk的路径名有问题,因为我一开始是D:\jdk1.8.0_40(这个是JAVA_HOME的)(PS网上说,要在环境变量的系统变量里设置CLASS_PATH、JAVA_HOME、path这些可以百度查)后来,我把jdk的名字改为jdk1.8.0.40,同时也把环境变量里的xx的用户变量和下面的系统变量里面有关jdk路径的设置的都改到D:\jdk1.8.0.40\(这只是JAVA_HOME的,其他的也就是吧jdk的名字改了),接着要重启下才行。
后来,再运行命令行,它就报了错:...java.lang.IllegalStateException: BeanFactory not initialized or already closed ...
看着是Bean没启动。最后,我就试试看,把jdk改为用jdk1.7.0.21的,同上把环境变量里的也做了更改,再重启下,然后我运行了命令行win64\activemq.bat;魂淡,它居然就成功了…..最后的结果是这样的
总结,activemq5.13.2配的jdk应该用的是jdk1.7的,我做的更改,就是把计算机的名字改为纯英文的(没有中间横杆),jdk文件夹的名字也没有下划线或其他字符,环境变量里的系统变量里增加了下面几项:
CLASS_PATH:.;%JAVA_HOME%\lib;%JAVA_HOME%\lib\tools.jar
JAVA_HOME:D:\jdk1.7.0.21\
Path:D:\jdk1.7.0.21\bin(如果原来还在系统变量加path的,记得补上 “;C:\Windows\System32”,不然查不了ipconfig的)
哥能做的只有这么多了,原来有预想弄activemq可能网上解决文档难找,没想到这么稀缺,找了好久一堆雷同,就是没卵用。在此添上一点解决办法,希望有用。