wood burning stoves 2.0*
The moose likes Tomcat and the fly likes Launching tomcat with jsvc Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Launching tomcat with jsvc" Watch "Launching tomcat with jsvc" New topic
Author

Launching tomcat with jsvc

Jim Babcock
Ranch Hand

Joined: Dec 03, 2004
Posts: 55
I've already posted this question on the jakarta commons mailing list, but I thought I'd try here, as well.

I'm running tomcat 5.0.28 on FreeBSD and want to run tomcat as a daemon. I'm using a PERL script to start it and everything runs fine... until I try to change one of my JSP pages, then tomcat can't find the java compiler.

I'll list the script below, but I'm reasonably sure I'm specifying JAVA_HOME correctly. I did some google research and found what I think is a plausible explaination, but I don't know how to apply their windows solution to my unix happenstance.

They said that when launching tomcat as a daemon, it launches a different executable that sets it's own JAVA_HOME and keeps it at a particular registery entry and that you only have to correct this to fix the issue. With Unix neither the registery or the listed executable are relavant.


Thanks,

Jimbus

#!/usr/bin/perl

$ENV{'JAVA_HOME'} = '/usr/local/jdk1.4.2';
$ENV{'LD_LIBRARY_PATH'} =
'/usr/local/jdk1.4.2/lib:/usr/local/jdk1.4.2/jre/lib/i
386/client:/usr/local/jdk1.4.2/jre/lib/i386';
$ENV{'PATH'} =
'/usr/local/jdk1.4.2/bin:/sbin:/bin:/usr/sbin:/usr/bin/usr/local/
sbin:/usr/local/bin';


`/usr/local/tomcat/bin/jsvc -user appadmin -cp
/usr/local/tomcat/bin/bootstrap.jar -outfile
/usr/local/tomcat/logs/catalina.out -errfile /usr/local/tomcat/logs
/catalina.err -pidfile /usr/local/tomcat/logs/CATALINA_PID
-Djava.net.preferIPv4Stack=true
-Djava.endorsed.dirs=/usr/local/tomcat/common/endorsed
-Dcatalina.home=/usr/local/tomcat
-Djava.io.tmpdir=/usr/local/tomcat/work
org.apache.catalina.startup.Bootstrap start`
Jim Babcock
Ranch Hand

Joined: Dec 03, 2004
Posts: 55
No takers on this? Just thought I'd float it back to the top for another attempt to get help on this one.
Peter Hewitt
Greenhorn

Joined: Apr 28, 2005
Posts: 1
I use jsvc on Debian, can't remember where I got my tomcat start script, but in mine it includes additional jars in the classpath. I think you need tools.jar for tomcat to be able to compile jsps.

...
CLASSPATH=\
$JAVA_HOME/lib/tools.jar:\
$CATALINA_HOME/bin/commons-daemon.jar:\
$CATALINA_HOME/bin/bootstrap.jar
...
jsvc -cp $CLASSPATH ...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Launching tomcat with jsvc
 
Similar Threads
OK I give up: ClassNotFound error for modelmbean
Installing Java on Linux (FC6)
is there something wrong with my classpath?
Environment Variable
ActionServlet compilation error