tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hannes Schmidt <m...@schmidt-net.via.t-online.de>
Subject Re: crontab problems
Date Tue, 25 Feb 2003 11:29:08 GMT
Right, you might also just put

JAVA_HOME=...

at the beginning of your crontab.

I assume you have good reasons to use a Java program to watch Tomcat.
Personally, I would have written a shell script. If you really want to use
Java, you might want to use a different, more reliable approach to detect
(un)availability of Tomcat, something like

import java.net.*;
URL url = new URL( "http://localhost:8080/examples" );
URLConnection con = url.openConnection();
con.setUseCaches( false );
con.connect();
if( con.getContentLength() > 0 ) {
    // restart tomcat
}

But I just wrote this out of my head ...

----- Original Message -----
From: "Ralph Einfeldt" <ralph.einfeldt@uptime-isc.de>
To: "Tomcat Users List" <tomcat-user@jakarta.apache.org>
Sent: Tuesday, February 25, 2003 10:43 AM
Subject: RE: crontab problems


You have to make shure that your script retstart_tomcat
sets and exports all needed environment variables before
calling ./startup.sh:

JAVA_HOME=/usr/local/java/jdk1.3.1
CATALINA_HOME=<path to tomcat installation>
CATALINA_BASE=<path to tomcat instance> or $CATALINA_HOME
# JAVA_OPTS='-client -v'

export JAVA_HOME CATALINA_HOME CATALINA_BASE JAVA_OPTS
./startup.sh

> -----Original Message-----
> From: Ayhan Peker [mailto:ayhan@image-data.com]
> Sent: Tuesday, February 25, 2003 10:30 AM
> To: tomcat-user@jakarta.apache.org
> Subject: crontab problems
>
> but the last two lines returns
> /////////////////////////
> The JAVA_HOME environment variable is not defined
> message..
> /////////////////////////
> my retstart_tomcat scrip is
> #!/bin/sh
> cd /usr/local/tomcat/bin
> ./startup.sh

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message