The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.
|
 |
|
Dev Shed Forums
> Programming Languages
> Java Help
|
crontab of script doesn't work but manual does
Discuss crontab of script doesn't work but manual does in the Java Help forum on Dev Shed. crontab of script doesn't work but manual does Java Help forum discussing all Java platforms - J2ME, J2SE and J2EE - as well as relevant standards, APIs and frameworks such as Swing, Servlets, JSPs, Applets, Struts, Spring, Hibernate, ANT, EJB, and other Java-related topics.
|
|
 |
|
|
|
|

Dev Shed Forums Sponsor:
|
|
|

March 15th, 2002, 03:49 PM
|
|
Junior Member
|
|
Join Date: Mar 2002
Location: WI
Posts: 0
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
crontab of script doesn't work but manual does
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
|

March 16th, 2002, 03:26 AM
|
 |
Modding: Oracle MsSQL Firebird
|
|
Join Date: Jun 2001
Location: Outside US
|
|
|
Hey genius, this is the JAVA SERVLETS & JSP FORUM!
|

March 16th, 2002, 08:55 AM
|
|
Junior Member
|
|
Join Date: Mar 2002
Location: WI
Posts: 0
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
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
|

March 16th, 2002, 12:18 PM
|
 |
Modding: Oracle MsSQL Firebird
|
|
Join Date: Jun 2001
Location: Outside US
|
|
|
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?
|

March 16th, 2002, 11:44 PM
|
 |
Banned ;)
|
|
Join Date: Nov 2001
Location: Woodland Hills, Los Angeles County, California, USA
|
|
|
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]
|
Developer Shed Advertisers and Affiliates
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|