【问题标题】:What's the correct Maven dependencies to use Spring JMS and ActiveMQ?使用 Spring JMS 和 ActiveMQ 的正确 Maven 依赖项是什么?
【发布时间】:2012-09-15 20:31:49
【问题描述】:

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

<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>

还有码头插件

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

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

org.springframework.beans.FatalBeanException: NamespaceHandler 类 [org.apache.xbean.spring.context.v2.XBeanNamespaceHandler] 对于 未找到命名空间 [http://activemq.apache.org/schema/core];嵌套的 例外是 java.lang.ClassNotFoundException: org.apache.xbean.spring.context.v2.XBeanNamespaceHandler

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

【问题讨论】:

    标签: spring maven jetty activemq spring-jms


    【解决方案1】:

    你需要依赖 xbean-spring

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

    【讨论】:

      【解决方案2】:

      如果您的意图是将这些依赖项作为“提供”的依赖项添加到您的 web 应用程序,然后使它们成为 jetty-maven-plugin 本身的依赖项,您可以在 jetty-maven-plugin 的 decl 内添加标签。假设您验证了您缺少的类存在于这些依赖项或其传递依赖项中。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2019-03-10
        • 1970-01-01
        • 2011-09-14
        • 2015-04-13
        • 1970-01-01
        • 2019-02-15
        • 1970-01-01
        • 2021-01-25
        相关资源
        最近更新 更多