Java – what dependencies are required for the embedded ActiveMQ proxy?
•
Java
I am trying to use the embedded ActiveMQ agent for unit testing as follows: http://activemq.apache.org/how-to-unit-test-jms-code.html
What Maven dependencies do I need to include? At present, I have 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>
That's what I got:
java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file javax/jms/JMSException
When attempting to instantiate an agent:
final BrokerService broker = new BrokerService();
What else should I add to the Maven dependency list? (I don't use spring)
Solution
The solution is simple, just remove the javax: Java EE API dependency
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码