You need to add the .jar files your app need to $TOMCAT/webapps/$YOUR_WEB_APP/WEB-INF/lib/
and then restart tomcat.
Вопрос
I'm trying to deploy a web app to tomcat using ANT but I ran into this error (the app compiles fine in a simple ant task. The issue occurs when Tomcat is restarted):
Caused by: java.lang.ClassNotFoundException: org.slf4j.Logger
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1714)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)
... 24 more
I red a couple of answers around here which state that besides slf4j
an implementation such as log4j
. This is an excerpt of the build.xml
file:
<pathelement location="${slf4j-api-1.7.2.jar}"/>
<pathelement location="${log4j.jar}"/>
These are path elements used in the classpath of the build's javac
command.
Besides not adding log4j as a dependency, what may be other reasons for this issue. Any kind of help would be appreciated. Thanks!
Решение
You need to add the .jar files your app need to $TOMCAT/webapps/$YOUR_WEB_APP/WEB-INF/lib/
and then restart tomcat.
Другие советы
I solved this problem copying this 2 JARs below.
from (assuming you are using Maven to manage your dependecies):
to (apache installation folder):