英文:
Spring JMS Baeldung tutorial code cannot connect to ActiveMQ
问题
我已成功构建了来自此存储库的示例代码。然而,当我运行此测试应用程序时,我收到以下错误:
ERROR | 无法刷新目的地为'queue-1'的JMS连接 - 重试使用FixedBackOff{interval=5000, currentAttempts=2, maxAttempts=unlimited}。原因:无法连接到代理程序URL:tcp://localhost:61616。原因:java.net.ConnectException:拒绝连接:没有进一步的信息
我不确定从哪里开始排查。我尝试在我的工作PC和一个EC2 Windows实例上运行它,以确保不是公司防火墙之类的问题。结果在两台机器上都相同。
英文:
I have successfully built example code from this repo. However, when I run this testing application I get the following error:
ERROR | Could not refresh JMS Connection for destination 'queue-1' - retrying using FixedBackOff{interval=5000, currentAttempts=2, maxAttempts=unlimited}. Cause: Could not connect to broker URL: tcp://localhost:61616. Reason: java.net.ConnectException: Connection refused: no further information
I'm not sure where to start troubleshooting. I tried it on my work PC and on an EC2 Windows instance to make sure it's not my company firewall or something like that. Result is the same on both machines.
答案1
得分: 0
为了启动嵌入式的 ActiveMQ 代理,我需要运行项目中包含的单元测试。
单元测试包括代理初始化:
public static EmbeddedActiveMQBroker embeddedBroker = new EmbeddedActiveMQBroker();
英文:
To start the embedded ActiveMQ broker I needed to run unit tests included with the project.
The unit test included broker initialization:
public static EmbeddedActiveMQBroker embeddedBroker = new EmbeddedActiveMQBroker();
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论