Environment Gentoo, Apache-2.0.59, Tomcat-6
Problem Need to configure Tomcat-6 behind Apache and custom applications (stadtplan and Mobile Geizhals) depend on some libraries.
Solution
Add c3p0 to USEFLAGS.
emerge c3p0 mod_jk jdbc-mysql
Edit /etc/conf.d/tomcat-6 CLASSPATH=${CATALINA_LIBDIR}:`java-config -p commons-logging,c3p0,jdbc-mysql`
I could not find the SpringFramework in the portage tree. But adding it to the classpath is a bad idea anyway. I received the following error message
Unable to load class for JSP
Just place the spring.jar into WEB-INF/lib of your application. Any tips on the web like, putting tools.jar into /usr/share/tomcat-6/lib/ don't help.
You need to put a proper .xml file into /etc/tomcat-6/Catalina/localhost/.xml. Just copy an existing one there.
Debugging
cat /var/log/tomcat-6/catalina.*.log
cat /var/log/tomcat-6/localhost.*.log
java-config -l