开发者

What dependencies do I need for embedded ActiveMQ broker?

I'm trying to use embedded ActiveMQ broker for unit testing, as explained here: http://activemq.apache.org/how-to-unit-test-jms-code.html

What Maven dependencies I need to include? At the moment I have just these:

<dependency>
  <groupId>javax</groupId>
  <artifactId>javaee-api</artifactId>
  <version>6.0</version>
  <scope>provided</scope>
</dependency>
<dependency>
  <groupId>org.apache.activemq</groupId>
  <artifactId>activemq-core</artifactId>
  <version>5.5.0</version>
</dependency>

This is what I'm getting:

java.lang.ClassFormatError: Absent Code attribute in method that 
is not native or abstract in class file javax/jms/JMSException

When trying to instantiate a broker:

final BrokerService broker = new BrokerService();

What else should I add to the list of Maven开发者_开发问答 dependencies? (I'm not using Spring)


The solution is simple, just need to remove the javax:javaee-api dependency.


can you try activemq-all:

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


moved the javaee dependency to the end of the class path. This solved my problem.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜