I am trying to use ActiveMQ via JNDI, deploying the application in Tomcat 7.0 server.
I have made the settings for ActiveMQ connection factory and queue in Tomcat context.xml
configuration file, and they look like this:
<Resource
auth="Container"
brokerName="LocalActiveMQBroker"
brokerURL="vm://localhost"
clientID="TomcatClientID"
description="JMS Connection Factory"
factory="org.apache.activemq.jndi.JNDIReferenceFactory"
name="jms/ConnectionFactory"
password="password"
type="org.apache.activemq.ActiveMQConnectionFactory"
userName="user"/>
<Resource
auth="Container"
description="Order Queue"
factory="org.apache.activemq.jndi.JNDIReferenceFactory"
name="jms/orderQ"
physicalName="orderQ"
type="org.apache.activemq.command.ActiveMQQueue"/>
and I try to get the connection factory this way:
nnectionFactory connectionFactory = (ConnectionFactory) context
.lookup("java:comp/env/jms/ConnectionFactory");
but I get an exception:
java.lang.NoClassDefFoundError: org/slf4j/impl/StaticLoggerBinder
org.slf4j.LoggerFactory.getSingleton(LoggerFactory.java:230)
I tried to find out the cause of the exception, but I found only that it could come from commons-logging jar, which I have added to tomcat lib folder.
Where am I wrong?