本地ActiveMQ启动失败

时间:2025-03-20 21:56:27
1,之前安装完activeMQ,启动了就一直没有管,后来系统升级,当自己访问localhost:8161的时候,连接失败。找到自己activeMQ安装目录下,双击显示启动失败,查看日志,日志如下:
Exception encountered during context initialization - cancelling refresh attempt | $1 | WrapperSimpleAppMain
: Error creating bean with name '#0' defined in class path resource []: Invocation of init method failed; nested exception is : Transport Connector could not be registered in JMX: : Failed to bind to server socket: stomp://0.0.0.0:61613?maximumConnections=1000&=104857600 due to: : Address already in use: JVM_Bind
	at (:1514)[spring-beans-3.2.:3.2.]
	at (:521)[spring-beans-3.2.:3.2.]
	at (:458)[spring-beans-3.2.:3.2.]
	at $(:293)[spring-beans-3.2.:3.2.]
	at (:223)[spring-beans-3.2.:3.2.]
	at (:290)[spring-beans-3.2.:3.2.]
	at (:191)[spring-beans-3.2.:3.2.]
	at (:636)[spring-beans-3.2.:3.2.]
	at (:934)[spring-context-3.2.:3.2.]
	at (:479)[spring-context-3.2.:3.2.]
	at .<init>(:64)[xbean-spring-3.:3.18]
	at .<init>(:52)[xbean-spring-3.:3.18]
	at $1.<init>(:104)[activemq-spring-5.12.:5.12.0]
	at (:104)[activemq-spring-5.12.:5.12.0]
	at (:67)[activemq-spring-5.12.:5.12.0]
	at (:71)[activemq-broker-5.12.:5.12.0]
	at (:54)[activemq-broker-5.12.:5.12.0]
	at (:87)[activemq-console-5.12.:5.12.0]
	at (:62)[activemq-console-5.12.:5.12.0]
	at (:154)[activemq-console-5.12.:5.12.0]
	at (:62)[activemq-console-5.12.:5.12.0]
	at (:104)[activemq-console-5.12.:5.12.0]
	at .invoke0(Native Method)[:1.8.0_73]
	at (Unknown Source)[:1.8.0_73]
	at (Unknown Source)[:1.8.0_73]
	at (Unknown Source)[:1.8.0_73]
	at (:262)[:5.12.0]
	at (:115)[:5.12.0]
	at .invoke0(Native Method)[:1.8.0_73]
	at (Unknown Source)[:1.8.0_73]
	at (Unknown Source)[:1.8.0_73]
	at (Unknown Source)[:1.8.0_73]
	at (:240)[:3.2.3]
	at (Unknown Source)[:1.8.0_73]

2,显示的是端口61613被占用,命令行输入 netstat -ano|findstr "61613",找到占用这个端口的进程的PID,在任务管理器根据PID禁用掉这个进程就可以了。

3,然后,再双击,弹出的命令行最后一行为“。。。。allowed”,就证明启动成功。

4,访问localhost:8161,访问成功。

5,我们可以双击下面的将activeMQ加入到服务中,在此启动了,那么之后,就不用每次手动启动了。


其实,在访问失败的时候,我首先查看的是61616端口是否被占用,结果没有被占用,查看日志,才发现61613被占用了。打开,就可以看到MQ相关的端口情况了。还有,遇到问题查看日志,可以直接找到问题根源,即使自己无法解决,把日志粘贴到网上也可以找到其他人的解决办法