[lug] tomcat5.5 as daemon on FC4

D. Stimits stimits at comcast.net
Sun Nov 20 12:53:49 MST 2005


...
> 
> Just a quick stab in the dark, what happens if you explicitly export the
> CLASSPATH before jsvc is called.

I've had that set in my shell variables for the entire time. Plus I've 
tried hard coding it into scripts at one time or another. In any case, 
no difference with or without it from outside the scripts when using 
scripts. The thing is that if the CLASSPATH were bad, then the manual 
bin/startup.sh would also fail, but works fine. Error logs all indicate 
it can't find the DaemonLoader, and when other variables are set wrong, 
it won't even get that far. Here's a sample via echo of what the script 
is actually calling:
# echo $DAEMON_HOME/bin/jsvc 
-Djava.endorsed.dirs=$DAEMON_HOME/common/endorsed 
-Dcatalina.home=$CATALINA_HOME -Dcatalina.base=$CATALINA_BASE -cp 
$CLASSPATH -outfile ./logs/catalina.out -errfile ./logs/catalina.err 
org.apache.catalina.startup.Bootstrap

/usr/local/tomcat5/bin/jsvc 
-Djava.endorsed.dirs=/usr/local/tomcat5/common/endorsed 
-Dcatalina.home=/usr/local/tomcat5 -Dcatalina.base=/usr/local/tomcat5 
-cp /opt/jdk1.5.0_05/lib/tools.jar: 
/usr/local/tomcat5/bin/commons-daemon.jar: 
/usr/local/tomcat5/bin/bootstrap.jar -outfile ./logs/catalina.out 
-errfile ./logs/catalina.err org.apache.catalina.startup.Bootstrap

As you can see in this excerpt:
-cp /opt/jdk1.5.0_05/lib/tools.jar: 
/usr/local/tomcat5/bin/commons-daemon.jar: 
/usr/local/tomcat5/bin/bootstrap.jar

...it definitely has a correct CLASSPATH, and the path includes 
commons-daemon.jar, which in turn is verified as containing the 
DaemonLoader it claims is not there. Something really simple is probably 
getting in the way of it finding

> 
> Also, if you run through the script by hand (copy/paste), does it work?

No difference. I actually created the script out of frustration of too 
much mouse copy and paste, so all of the initial testing was done with a 
mouse copy...only later did I switch to a script. The full error log is:

#######################
java.lang.ClassNotFoundException: org.apache.catalina.startup.Bootstrap
         at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
         at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
         at 
org.apache.commons.daemon.support.DaemonLoader.load(DaemonLoader.java:107)
20/11/2005 12:50:32 18929 jsvc.exec error: Cannot load daemon
20/11/2005 12:50:32 18928 jsvc.exec error: Service exit with a return 
value of 3
#######################

D. Stimits, stimits AT comcast DOT net



More information about the LUG mailing list