Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 38952

Summary: Tomcat 4.1.24-r1 crashes on start when setting endorsed libs directory
Product: Gentoo Linux Reporter: Michael Hafner <mail>
Component: Current packagesAssignee: Java team <java>
Status: RESOLVED FIXED    
Severity: normal    
Priority: High    
Version: unspecified   
Hardware: x86   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 38949    

Description Michael Hafner 2004-01-21 12:45:52 UTC
This bug is related to bug 38949 (Tomcat 4.1.24-r1 does not set endorsed libs directory).

Setting the JAVA_ENDORSED_LIBS directory like described in bug 38949 in the /opt/tomcat/bin/setclasspath.sh file to the correct /opt/tomcat/common/endorsed directory leads to Tomcat crashing on start with the the following exception:
org.apache.commons.logging.LogConfigurationException: java.lang.NullPointerException
        at org.apache.commons.logging.LogFactory.newFactory(LogFactory.java:558)
        at org.apache.commons.logging.LogFactory.getFactory(LogFactory.java:355)
        at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:409)
        at org.apache.commons.digester.Digester.<init>(Digester.java:352)
        at org.apache.catalina.startup.Catalina.createStartDigester(Catalina.java:280)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:441)
        at org.apache.catalina.startup.Catalina.execute(Catalina.java:400)
        at org.apache.catalina.startup.Catalina.process(Catalina.java:180)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203)
Caused by: java.lang.NullPointerException
        at org.apache.commons.logging.LogFactory.newFactory(LogFactory.java:543)
        ... 12 more

(re)moving the file "commons-logging-api.jar" out of the /opt/tomcat/common/endorsed directory "solves" the problem and Tomcat starts normally.

Reproducible: Always
Steps to Reproduce:
1. Set the JAVA_ENDORSED_LIBS variable in /opt/tomcat/bin/setclasspath.sh 
2. Start Tomcat	
Actual Results:  
Tomcat fails with an exception.	 

Expected Results:  
Start normally. 

Gentoo Base System version 1.4.3.11 
Portage 2.0.49-r20 (default-x86-1.4, gcc-3.3.1, glibc-2.3.2-r9, 
2.4.22-gentoo-test-r0) 
================================================================= 
System uname: 2.4.22-gentoo-test-r0 i686 Mobile Intel(R) Pentium(R) 4 - M CPU 
2.00GHz 
ACCEPT_KEYWORDS="x86" 
AUTOCLEAN="yes" 
CFLAGS="-march=pentium3 -O3 -pipe" 
CHOST="i686-pc-linux-gnu" 
COMPILER="gcc3" 
CONFIG_PROTECT="/etc /opt/tomcat/conf /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config /usr/kde/3.1/share/config /usr/kde/3/share/config /usr/share/config /var/qmail/control" 
CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d" 
CXXFLAGS="-march=pentium3 -O3 -pipe" 
DISTDIR="/usr/portage/distfiles" 
FEATURES="autoaddcvs ccache sandbox" 
GENTOO_MIRRORS="http://distro.ibiblio.org/pub/Linux/distributions/gentoo" 
MAKEOPTS="-j2" 
PKGDIR="/usr/portage/packages" 
PORTAGE_TMPDIR="/var/tmp" 
PORTDIR="/usr/portage" 
PORTDIR_OVERLAY="" 
SYNC="rsync://rsync.gentoo.org/gentoo-portage" 
USE="X alsa apm arts avi berkdb crypt cups encode esd foomaticdb gdbm gif gnome 
gpm gtk gtk2 imlib jpeg kde libg++ libwww mad mikmod mmx motif mpeg mysql 
ncurses nls oggvorbis opengl oss pam pdflib perl png python qt quicktime 
readline sdl slang spell ssl svga tcpd truetype x86 xml2 xmms xv zlib"
Comment 1 Michael Hafner 2004-01-23 14:21:26 UTC
Setting 
CATALINA_OPTS="-Dorg.apache.commons.logging.LogFactory=org.apache.commons.logging.impl.LogFactoryImpl"
in /opt/conf.d/tomcat makes tomcat start successfully without the exception.

Additional Information on commons-logging can be found here:
http://jakarta.apache.org/commons/logging/api/org/apache/commons/logging/package-summary.html

Comment 2 Chris Aniszczyk (RETIRED) gentoo-dev 2004-02-15 17:51:35 UTC
Fixed in the latest 4.1.29 and 5.0x