ActiveMQ嵌入式代理,关机挂钩中的异常 [英] ActiveMQ embedded broker, exception in shutdown hook
问题描述
使用嵌入式代理在关机时出现以下错误:
I get the following error on shutdown, using an embedded broker:
Exception in thread "ActiveMQ ShutdownHook" java.lang.NoClassDefFoundError: org/apache/activemq/broker/BrokerService
我可能配置有误吗?我使用了activemq页面上的配置:
Have I misconfigured something possibly? I used the config spelled out on the activemq page here:
http://activemq. apache.org/how-do-i-embed-a-broker-inside-a-connection.html
(底部标记为"using spring-2.0"的配置).邮件已正确传递,等等.因此,我不确定此错误是否无害.
(the configuration labeled "using spring-2.0" at the bottom). The messages are being delivered properly etc. so I'm not sure if this error is harmless.
推荐答案
这是一个老问题,当ActiveMQ嵌入并且未正确配置为100%时,可能会发生.链接的配置中唯一遗漏的是将useShutdownHook="false"
添加到XML配置的<broker>
元素中.下面是一个简单的示例:
This is an old issue that can occur when ActiveMQ is embedded and not configured 100% correct. The only thing that is left out in the config you linked is to add useShutdownHook="false"
to the <broker>
element of the XML config. Below is a quick example:
<amq:broker useJmx="false" persistent="false" useShutdownHook="false">
...
</amq:broker>
这将禁用关闭挂钩,并防止出现此问题.
This will disable the shutdown hook and prevent this problem from occurring.
这篇关于ActiveMQ嵌入式代理,关机挂钩中的异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!