|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here! |
|
#1
|
|||
|
|||
|
I'm trying to run a Perl script via crontab that produces the following crontab error:
"Exception in thread "main" java.lang.NoClassDefFoundError: Convert" This Perl script has the following: "system ("/usr/bin/java Convert midwest_callout.csv \"Midwest Callout\" /s:,");" This script runs via a shell session with no problems what-so-ever. It's rather a pain in the neck to run it every morning though so I want to be able to cron it. Here's what my Sys Admin says: "Suspect it has to do something with environmental variables that are auto-set when you shell into the box, or something to that effect." Does he have a point? How can I set this up correctly within the script so that the java error is not passed back to the crontab? Thanks for any ideas or leads on this problem. As I said, it works fine and I've been doing it manually via shell access for the past several weeks but I'm tired of doing so. Plus, I want to take a vacation and know that this will be working by itself ;-) Chris |
|
#2
|
||||
|
||||
|
Hey genius, this is the JAVA SERVLETS & JSP FORUM!
__________________
My blog about OpenSource Databases PDF tutorials about OSS databases, DBMonster ... Please contribute to Open Source Development, fill bug reports!!! Developer Shed eSupport Commented my.ini/my.cnf (PLEASE ADD YOUR OWN CONFIG TRICK) An introduction to database normalization Natural or Surrogate key Custom ordering for your results Correlated and uncorrelated subqueries Don't turn your outer joins into inner joins |
|
#3
|
|||
|
|||
|
Genius
So where should I post this? The error states: "Exception in thread "main" java.lang.NoClassDefFoundError: Convert" That being java I figured this would be the place to post.
Thanks for your previous, highly informative reply. Chris |
|
#4
|
||||
|
||||
|
So why you wrote "Perl script"?
If it calls a java program, why don't you show us how it is done, and what that program is? |
|
#5
|
||||
|
||||
|
Have you tried putting the explicit paths to your Convert program and other files in the perl script:
"system ("/usr/bin/java /path/to/Convert /path/to/midwest_callout.csv \"Midwest Callout\" /s:,");" [edit] On second thoughts, you might also need to set your CLASSPATH environment variable properly. This can be passed via the command line or you can possibly run an export command before calling your program (by using a ; to separate the two commands)as in system("export CLASSPATH=paths;/usr/bin/java Convert ... rest of command line"); [/edit] |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Java Help > crontab of script doesn't work but manual does |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|