2009-08-05

java.lang.NoClassDefFoundError: javax/servlet/ServletContextListener

java.lang.NoClassDefFoundError: javax/servlet/ServletContextListener

solution 1:
Linux version of catalina/bin/setclasspath.sh in 5.5.15,17,20 hides
the following classpath setting under condition. With tools.jar in
classpath it works.


if [ "$1" = "debug" -o "$1" = "javac" ] ; then
CLASSPATH="$JAVA_HOME"/lib/tools.jar
fi


Btw, setclasspath.bat does not contain such condition as well as
bat/sh of 5.0.28


Sounds odd, but it helped.

solution 2:

servlet-api.jar is in common/lib.

Is the jar perchance in some other directory as well - such as inside

the webapp? It shouldn't be in more than one place.

0 留言: