java – 嵌入式ActiveMQ代理需要哪些依赖项?

我正在尝试使用嵌入式ActiveMQ代理进行单元测试,如下所述: http://activemq.apache.org/how-to-unit-test-jms-code.html

我需要包含哪些Maven依赖项?目前我有这些:

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

这就是我得到的:

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

尝试实例化代理时:

final brokerService broker = new brokerService();

我还应该在Maven依赖项列表中添加什么? (我不使用Spring)

解决方法

解决方案很简单,只需要删除javax:javaee-api依赖项.

相关文章

最近看了一下学习资料,感觉进制转换其实还是挺有意思的,尤...
/*HashSet 基本操作 * --set:元素是无序的,存入和取出顺序不...
/*list 基本操作 * * List a=new List(); * 增 * a.add(inde...
/* * 内部类 * */ 1 class OutClass{ 2 //定义外部类的成员变...
集合的操作Iterator、Collection、Set和HashSet关系Iterator...
接口中常量的修饰关键字:public,static,final(常量)函数...