Link to home
Start Free TrialLog in
Avatar of garry_m
garry_m

asked on

Cron Throws "Exception in thread "main" java.util.zip.ZipException: No such file or directory"

Hi,

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/myApp/runApplication.sh))

#!/bin/bash
/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)
        at java.util.zip.ZipFile.<init>(ZipFile.java:112)
        at java.util.jar.JarFile.<init>(JarFile.java:117)
        at java.util.jar.JarFile.<init>(JarFile.java:55)


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!
SOLUTION
Avatar of owensleftfoot
owensleftfoot

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of garry_m
garry_m

ASKER

Thanks guys!