Hi,
I am not really a beginner, but I am fairly sure this is a simple question, and I am just missing something simple.
I am running a web server on a VPS. I want to check if there are any new files on the server and if there are, add some records to a database. I have writen a
java app. and a script [1] that sets the CLASSPATH and runs the app. This runs fine from the command line, but fails when run as a cron job. I have writen a little
test app. that demonstates the problem [2]. The exception is at [3] with some more debugging info from the script.
The
jdbc jar file is in the right place [4].
Does anyone know what is going on here? If this belongs in a different forum let me know (or just move it).
Thanks for any help,
Hugh
[1] #! /bin/sh
whoami
echo $CLASSPATH
echo $PATH
CLASSPATH=/home/server/lib/mysql-connector-java-3.0.15-ga-bin.jar:.:/usr/local/jdk/lib/classes.zip:$CLASSPATH
PATH=/usr/local/jdk/bin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/usr/local/bin:/usr/X11R6/bin:/home/server/bin:$PATH
echo $CLASSPATH
echo $PATH
cd /home/server/public_html
/usr/java/bin/java TestClassLoader
[2]
[3]
[4]
[email protected] [~/public_html]# ll /home/server/lib/mysql-connector-java-3.0.15-ga-bin.jar
-rwxrwxrwx 1 server server 235712 Aug 7 13:17 /home/server/lib/mysql-connector-java-3.0.15-ga-bin.jar*
[ August 09, 2006: Message edited by: Huw Morgan ]
[ August 09, 2006: Message edited by: Huw Morgan ]