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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With