java - 如何解决 org.springframework.jms.config.JMSListenerEndpointRegister.isAutoStartUp()Z 错误?
问题描述
所以我正在构建一个 SpringFramework(4.3.20.RELEASE) 项目,向/从 activemq 服务器发送和接收消息(在这种情况下,我在 localhost 上拥有它)。
我能够将消息发送到队列,但无法从那里获取。这是我的消费者类和消费者配置类。
这是我在 POM 中的依赖项
<!-- JMS -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jms</artifactId>
<version>5.1.5.RELEASE</version>
</dependency>
<dependency>
<groupId>javax.jms</groupId>
<artifactId>javax.jms-api</artifactId>
<version>2.0.1</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-all</artifactId>
<version>5.10.0</version>
</dependency>
这是我的 ConsumerConfig 类
@Configuration
@EnableJms
public class ReceiverConfig {
private String brokerUrl = "tcp://localhost:61616";
@Bean
public ActiveMQConnectionFactory receiverActiveMQConnectionFactory() {
ActiveMQConnectionFactory activeMQConnectionFactory = new ActiveMQConnectionFactory();
activeMQConnectionFactory.setBrokerURL(brokerUrl);
return activeMQConnectionFactory;
}
@Bean
public DefaultJmsListenerContainerFactory jmsListenerContainerFactory() {
DefaultJmsListenerContainerFactory factory = new DefaultJmsListenerContainerFactory();
factory.setConnectionFactory(receiverActiveMQConnectionFactory());
factory.setConcurrency("1-1");
return factory;
}
@Bean
public Receiver receiver() {
return new Receiver();
}
}
和消费类
public class Receiver {
private static final Logger logger = LoggerFactory.getLogger(Receiver.class);
@Autowired
private Processor processor;
@JmsListener(destination = "my.queue", containerFactory = "jmsListenerContainerFactory")
public void receive(String message) {
logger.info("We have read message " + message + " from Queue");
}
}
我得到的错误
[2020-03-24 04:57:53,405] Artifact {my-project}:war: java.lang.Exception: {"WFLYCTL0080: Failed services" => {"jboss.undertow.deployment.default-server.default-host.\"/{my-project}\"" => "org.jboss.msc.service.StartException in service jboss.undertow.deployment.default-server.default-host.\"/{my-project}\": java.lang.AbstractMethodError: org.springframework.jms.config.JmsListenerEndpointRegistry.isAutoStartup()Z
Caused by: java.lang.AbstractMethodError: org.springframework.jms.config.JmsListenerEndpointRegistry.isAutoStartup()Z"},"WFLYCTL0412: Required services that are not installed:" => ["jboss.undertow.deployment.default-server.default-host.\"/{my-project}\""],"WFLYCTL0180: Services with missing/unavailable dependencies" => undefined}
解决方案
推荐阅读
- r - 使用另一个函数重现 hist() 的 $count 方面
- kotlin - 如何仅使用元素上的特定序列来减少列表
- typescript - 如何使用 SPFx - 字段定制器对 SharePoint 列表字段值进行条件格式设置?
- python - 在 matplotlib 中将一个动画叠加到另一个动画上
- typescript - 基于字段的 TypeScript 通用推断
- python - 使用标准输出维护 C# 和 Python 之间的连接
- r - 比较 R 中不同长度的数据帧,并在不同的行中添加零
- c# - 线程图像
- laravel - 将 oracle 酒店 pms 与 laravel 应用程序集成
- javascript - 有时 JQuery 不能正常工作,但会出现异常:“ $(...).'nameFunction' is not a function ”,有时它可以工作