I’m running into the following error when attempting to initialize a JMS connection between a servlet on Tomcat and a local ActiveMQ instace.
java.lang.NoSuchMethodError: org.slf4j.helpers.MessageFormatter.format(Ljava/lang/String;Ljava/lang/Object;)Lorg/slf4j/helpers/FormattingTuple;
at org.slf4j.impl.Log4jLoggerAdapter.warn(Log4jLoggerAdapter.java:420)
at org.apache.activemq.transport.tcp.TcpTransportFactory.createTransport(TcpTransportFactory.java:132)
at org.apache.activemq.transport.TransportFactory.doConnect(TransportFactory.java:141)
at org.apache.activemq.transport.TransportFactory.doConnect(TransportFactory.java:51)
at org.apache.activemq.transport.TransportFactory.connect(TransportFactory.java:80)
at org.apache.activemq.ActiveMQConnectionFactory.createTransport(ActiveMQConnectionFactory.java:243)
at org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection(ActiveMQConnectionFactory.java:258)
at org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection(ActiveMQConnectionFactory.java:230)
at org.apache.activemq.ActiveMQConnectionFactory.createTopicConnection(ActiveMQConnectionFactory.java:208) ...
I believe all my dependencies are in order. Other threads have suggested it’s a problem with mismatched slf4j jar libraries. Here is my lib directory.
root@TestDebS:/usr/local/jakarta-tomcat-4.1.24/webapps/examples/WEB-INF# ls lib/
activemq-all-5.5.1.jar exolabcore-0.3.5.jar jndi_1.2.1.jar openjms-0.7.5.jar slf4j-api-1.6.4.jar
classes12.zip exolabcore-0.3.7.jar log4j-1.2.14.jar openjms-0.7.6.1.jar slf4j-log4j12-1.6.4.jar
comm.jar javax.comm.properties log4j-1.2.8.jar openjms-0.7.6.jar xercesImpl.jar
commons-logging-api.jar jms_1.0.2a.jar servlet.jar
Both [tomcat root]/common/lib and [tomcat root]/shared/lib have nothing noteworthy in them. Anyone have any ideas? Thanks in advance for any help you can give!
You have multiple versions of multiple libraries in your WEB-INF/lib; this is a bad idea as it can lead to mixing-and-matching of the different versions depending on which versions contain specific signatures.
Also, you must not deploy your own servlet.jar if that’s the servlet API. The errors this causes are often non-obvious. May not solve this problem, but it will certainly stop others from occurring.