Posted By:
AlessandroA_Garbagnati
Posted On:
Wednesday, April 11, 2001 10:21 AM
Ryan,
Yes, according to the Servlet Specification, Tomcat automatically adds for each context, /WEB-INF/classes and all the *.jar (not *.zip, just *.jar) located in /WEB-INF/lib. It's working for me.
At the same time, I never had to change tomcat.sh to have tomcat reading the classpath. These lines (from the default
tomcat.sh, in fact, are the one responsible for the generation of the classpath:
for i in ${TOMCAT_HOME}/lib/* ; do
if [ "$CLASSPATH" != "" ]; then
CLASSPATH=${CLASSPATH}:$i
else
CLASSPATH=$i
fi
done
if [ -f ${JAVA_HOME}/lib/tools.jar ] ; then
# We are probably in a JDK1.2 environment
CLASSPATH=${CLASSPATH}:${JAVA_HOME}/lib/tools.jar
fi
I don't have any idea why your jars aren't added to the classpath. It could be that if the context classpath is added at the end of the original one, and you have some old version of the same package in the main lib directory, the ClassLoader does not get to the second... but it looks very weird...