Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 84206 - tomcat5 has classloading problems
Summary: tomcat5 has classloading problems
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High major (vote)
Assignee: Java team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-03-05 10:10 UTC by Santiago Gala
Modified: 2005-03-06 05:37 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Santiago Gala 2005-03-05 10:10:07 UTC
When catalina.sh boots, it has commons-logging in the CLASSPATH, but not log4j

webapps using log4j (most complex ones) will use different classloaders for both packages, leading to very obscure errors.

sgala@marlow ~ $ diff -u /usr/share/tomcat-5/bin/catalina.sh.orig /usr/share/tomcat-5/bin/catalina.sh
--- /usr/share/tomcat-5/bin/catalina.sh.orig    2005-03-05 18:14:31.000000000 +0100
+++ /usr/share/tomcat-5/bin/catalina.sh 2005-03-05 18:59:57.081324033 +0100
@@ -108,7 +108,7 @@
 if [ -n "$JSSE_HOME" ]; then
   CLASSPATH="$CLASSPATH":"$JSSE_HOME"/lib/jcert.jar:"$JSSE_HOME"/lib/jnet.jar:"$JSSE_HOME"/lib/jsse.jar
 fi
-CLASSPATH="$CLASSPATH":"$CATALINA_HOME"/bin/bootstrap.jar:"$CATALINA_HOME"/bin/commons-logging-api.jar
+CLASSPATH="$CLASSPATH":"$CATALINA_HOME"/bin/bootstrap.jar:`java-config -p commons-logging`:`java-config -p log4j`

The above patch will solve it, though I'm not sure if common-logging is needed in the bootstrap phase. If not, removing both can be an alternative solution, and adding commons-logging to /usr/share/tomcat-5/common/lib (to make it available to webapps)

Reproducible: Always
Steps to Reproduce:
1. emerge tomcat-5.0.28
2. deploy blojsom
3. wait for a obscure error about a log4j class not being available (it is in a different classloader)

Actual Results:  
blojsom refuses to deploy

Expected Results:  
with the above patch, and also removing commons-logging from the patched line,
things worked.
Comment 1 Santiago Gala 2005-03-06 04:34:23 UTC
Filed upstream:

http://issues.apache.org/bugzilla/show_bug.cgi?id=33869
Comment 2 Jan Brinkmann (RETIRED) gentoo-dev 2005-03-06 05:37:06 UTC
thanks for your report and the patch. i've added log4j to the classpath.