Clash of the Classes: Using ActiveMQ with Play Framework
Recently I have my hands on Play Framework and I am quite happy with all the features such as change the code and refresh the page attitude, stateless model for REST applications and easy method for unit and functional testing. In one of the projects I needed to access one of ActiveMQ instances I have, to this end I have included the required Java libraries (activemq-all-5.5.0.jar and javax.jms.jar), deployed the code to my test environment, clicked refresh.. and saw that pretty error page of Play Framework.
Oops: NoSuchMethodError An unexpected error occured caused by exception NoSuchMethodError: org.slf4j.helpers.MessageFormatter.format(Ljava/lang/String;Ljava/lang/Object;)Lorg/slf4j/helpers/FormattingTuple;
Checking the Play console output below, apparently the problem was that Play Framework is using slf4j library for logging and ActiveMQ 5.5.0 jar file includes a newer version of it as well.
SLF4J: The requested version 1.6 by your slf4j binding is not compatible with [1.5.5, 1.5.6, 1.5.7, 1.5.8, 1.5.9, 1.5.10, 1.5.11] SLF4J: See http://www.slf4j.org/codes.html#version_mismatch for further details.
The solution here is to step back and use one of ActiveMQ 5.4.x libraries that do not include the SLF4J library in it. I have used activemq-all-5.4.1.jar in this case successfully. It would be great if ActiveMQ guys could strip SLF4J from the package and let the developers add the library externally.















