Cron Throws "Exception in thread "main" java.util.zip.ZipException: No such file or directory"
Posted on 2004-11-26
I have scheduled a cron job to run at 8:00 o'clock every night without fail. Here is the crontab:
# DO NOT EDIT THIS FILE - edit the master and reinstall.
# (legacy.cron installed on Fri Nov 26 09:15:21 2004)
# (Cron version -- $Id: crontab.c,v 2.13 1994/01/17 03:20:37 vixie Exp $)
00 20 * * * /opt/myApp/runApplication.sh
When the application is run directly (not through Cron) it works fine. Its just a shell script that loads up a java application:
/opt/java/j2sdk/bin/java -Xbootclasspath/a:"/opt/myApp/resource.jar" -jar lib/myJar.jar -config myConfig.conf 2>&1 | tee /opt/myApp/logfile.log
However, when run through Cron, I receive the following error in the log file:
Exception in thread "main" java.util.zip.ZipException: No such file or directory
at java.util.zip.ZipFile.open(Native Method)
This is only when the app is run through Cron. As far as I am aware, the application doesn't call any zip functions, but I am quite new to Java and I could be wrong.
Any help would be brilliant, thanks!