Java Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesJava Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here!
  #1  
Old March 15th, 2002, 03:49 PM
mullman mullman is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2002
Location: WI
Posts: 0 mullman User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question 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

Reply With Quote
  #2  
Old March 16th, 2002, 03:26 AM
pabloj's Avatar
pabloj pabloj is offline
Modding: Oracle MsSQL Firebird
Dev Shed God 6th Plane (7500 - 7999 posts)
 
Join Date: Jun 2001
Location: Outside US
Posts: 7,711 pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 2 Months 2 Weeks 6 Days 5 h 22 m 58 sec
Reputation Power: 259
Hey genius, this is the JAVA SERVLETS & JSP FORUM!

Reply With Quote
  #3  
Old March 16th, 2002, 08:55 AM
mullman mullman is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2002
Location: WI
Posts: 0 mullman User rank is Just a Lowly Private (1 - 20 Reputation Level) 
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

Reply With Quote
  #4  
Old March 16th, 2002, 12:18 PM
pabloj's Avatar
pabloj pabloj is offline
Modding: Oracle MsSQL Firebird
Dev Shed God 6th Plane (7500 - 7999 posts)
 
Join Date: Jun 2001
Location: Outside US
Posts: 7,711 pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 2 Months 2 Weeks 6 Days 5 h 22 m 58 sec
Reputation Power: 259
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?

Reply With Quote
  #5  
Old March 16th, 2002, 11:44 PM
Scorpions4ever's Avatar
Scorpions4ever Scorpions4ever is offline
Banned ;)
Dev Shed God 5th Plane (7000 - 7499 posts)
 
Join Date: Nov 2001
Location: Glendale, Los Angeles County, California, USA
Posts: 7,442 Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level) 
Time spent in forums: 1 Month 1 h 55 m 33 sec
Reputation Power: 797
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]

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesJava Help > crontab of script doesn't work but manual does


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway