What's the correct Maven dependencies to use Spring JMS and ActiveMQ?
Asked Answered
R

2

10

This is quite a common problem and I have found plenty solutions that do not work for me on the web. I am declaring:

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

And jetty plug-in

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

But I keep on getting the following exception when issuing "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

What would be the correct maven dependencies to run Jetty, ActiveMQ and Spring JMS?

Roughneck answered 24/9, 2012 at 11:24 Comment(0)
R
13

You need dependency on xbean-spring

<dependency>
  <groupId>org.apache.xbean</groupId>
  <artifactId>xbean-spring</artifactId>
  <version>3.7</version>
</dependency>
Remodel answered 24/9, 2012 at 11:59 Comment(0)
S
2

If your intent is to have those dependencies as 'provided' dependencies to your webapp then make them dependencies of the jetty-maven-plugin itself, you can add tags inside of the decl of the jetty-maven-plugin. Assuming you validated the classes your missing exist in those dependencies or their transitive deps.

School answered 24/9, 2012 at 11:32 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.