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?

2 Answers2

13

You need dependency on xbean-spring

<dependency>
  <groupId>org.apache.xbean</groupId>
  <artifactId>xbean-spring</artifactId>
  <version>3.7</version>
</dependency>
Claus Ibsen
  • 56,060
  • 7
  • 50
  • 65
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.

jesse mcconnell
  • 7,102
  • 1
  • 22
  • 33