win下ActiveMQ启动报错:BeanFactory not initialized or already closed - call 'refresh' before ...
win下安装ActiveMQ:
官网下载:
本地解压:
进入bin/,根据自己电脑,选择win32/win64,点击activemq.bat 即可运行。
启动错误:
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
接着向上翻,看有没有更具体地提示:
ERROR | Failed to start Apache ActiveMQ (localhost, ID:DESKTOP-31JCR4J-55998-1557803455731-0:1)
jvm 1 | 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
看到这里,应该是5672端口被占用了。
查看5672被谁占用:netstat -aon | findstr "5672"
输入命令:tasklist | findstr "4240" 查找具体的占用进程
打开资源管理器,找到PID是4240的进程(没有PID这一列的话可以右击列添加PID列)
这个进程暂时也没啥用,直接结束它。
重新启动ActiveMQ。
启动成功!