spring - 使用 Spring JMS 和 ActiveMQ 的正确 Maven 依赖项是什么?

标签 spring maven jetty activemq spring-jms

这是一个很常见的问题,我在网上找到了很多不适合我的解决方案。我声明:

<dependency>
  <groupId>org.springframework</groupId>
  <artifactId>spring-jms</artifactId>
  <version>3.0.7.RELEASE</version>
</dependency>

<dependency>
  <groupId>org.apache.activemq</groupId>
  <artifactId>activemq-all</artifactId>
  <version>5.5.0</version>
</dependency>

还有 jetty 插件

<plugin>
  <groupId>org.mortbay.jetty</groupId>
  <artifactId>jetty-maven-plugin</artifactId>
</plugin>

但在发出“mvn jetty:run”时,我不断收到以下异常:

org.springframework.beans.FatalBeanException: NamespaceHandler class [org.apache.xbean.spring.context.v2.XBeanNamespaceHandler] for namespace [http://activemq.apache.org/schema/core] not found; nested exception is java.lang.ClassNotFoundException: org.apache.xbean.spring.context.v2.XBeanNamespaceHandler

运行 Jetty、ActiveMQ 和 Spring JMS 的正确 maven 依赖项是什么?

最佳答案

你需要依赖 xbean-spring

<dependency>
  <groupId>org.apache.xbean</groupId>
  <artifactId>xbean-spring</artifactId>
  <version>3.7</version>
</dependency>

关于spring - 使用 Spring JMS 和 ActiveMQ 的正确 Maven 依赖项是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12564059/

相关文章:

java - 当我尝试在Spring Boot应用程序中访问URL时找不到页面

java - 如何避免 Hibernate ValidationException 上的自动实体更新

java - 如何在 Java 中避免在保存到数据库之前同时处理唯一组合?

java - Spring Boot 应用程序未部署在 Glassfish 4.1 上

java - 在 IDE 和 JAR 中使用 Java 加载资源(从静态上下文)

java - 无法部署 apache tomcat web 应用程序 - 总是 404

java - 使用jetty服务器在eclipse中进行远程调试

java - Spring中不带@Configuration导入配置类

java - maven排除依赖中的插件

Jetty Run War 仅使用命令行