Latest LQ Deal: Latest LQ Deals
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


Closed Thread
  Search this Thread
Old 07-28-2010, 11:31 AM   #1
LQ Newbie
Registered: Jul 2010
Posts: 6

Rep: Reputation: 0
crontab wont work - runs manually fine

Sorry - wrote this message a couple of weeks ago then went on holiday.

My jar file runs fine manually - but fails to pick up a properties file when ran through crontab, any ideas???

throws it out into the exception part of this code

try {
props.load(new FileInputStream(""));
// assign value to message variable only if it is not null
if(props.getProperty("Propfile_day") !=null)
Propfile_day = props.getProperty("Propfile_day");
Propfile_monthyear = props.getProperty("Propfile_monthyear");
Propfile_country = props.getProperty("Propfile_country");
Propfile_airport = props.getProperty("Propfile_airport");

//catch exception in case properties file does not exist
catch(IOException e)
System.out.println("error in prop file");

the crontab is pretty basic...

41 11 * * * /home/seleniumTestResults/ 2>&1 > /home/seleniumTestResults/executeTests.log

the looks like this

export HOME="/root"
/usr/java/jdk1.5.0_12/bin/java -classpath /home/seleniumTestResults/shopOneSelenium.jar selenium.automation.Test

Last edited by alabama78; 07-28-2010 at 11:37 AM.
Old 07-28-2010, 11:50 AM   #2
Registered: Nov 2006
Distribution: RHEL, CentOS, Debian Lenny, Ubuntu
Posts: 638

Rep: Reputation: 113Reputation: 113
Is your shell script have execute permission ?

set execute permission

chmod 755 filename


use bash command in crontab

41 11 * * * /bin/bash /home/seleniumTestResults/ 2>&1 > /home/seleniumTestResults/executeTests.log
Old 07-28-2010, 12:08 PM   #3
LQ Newbie
Registered: Jul 2010
Posts: 6

Original Poster
Rep: Reputation: 0
tried both and it does the same unfortunatetly, the shell script does execute, but it fails in this part of the code

Last edited by alabama78; 07-28-2010 at 12:10 PM.
Old 07-28-2010, 12:20 PM   #4
Registered: Feb 2005
Location: Coventry, UK
Distribution: Home: Gentoo x86/amd64, Debian ppc. Work: Ubuntu, SuSe, CentOS
Posts: 343
Blog Entries: 1

Rep: Reputation: 72
What does the error say? -_-;
Old 07-28-2010, 12:23 PM   #5
LQ Newbie
Registered: Jul 2010
Posts: 6

Original Poster
Rep: Reputation: 0
.error in prop file
Time: 16.37
There was 1 error:
1) testTest(selenium.automation.Test)java.lang.NullPointerException
at selenium.automation.Test.testTest(
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(
at sun.reflect.DelegatingMethodAccessorImpl.invoke(
at com.thoughtworks.selenium.SeleneseTestCase.runBare(
at selenium.automation.Test.main(

Tests run: 1, Failures: 0, Errors: 1
Old 07-28-2010, 02:17 PM   #6
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 913Reputation: 913Reputation: 913Reputation: 913Reputation: 913Reputation: 913Reputation: 913Reputation: 913
Please post your thread in only one forum. Posting a single thread in the most relevant forum will make it easier for members to help you and will keep the discussion in one place. This thread is being closed because it is a duplicate.

Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
crontab wont work - runs manually fine alabama78 Linux - Newbie 5 08-02-2010 08:12 AM
[SOLVED] script not running via crontab, run's fine manually astroboiii Linux - Software 10 02-08-2010 11:36 PM
UBUNTU Intrepid Gampad Dpad wont work, works fine in jcalibrator zonemikel Linux - Hardware 1 03-22-2009 07:42 PM
When i try to play gmod or half life, it runs great, but the controls wont t-bone09 Linux - Games 11 12-23-2008 03:05 AM
script runs fine from a command line, but doesn't work from cron? kleptophobiac Linux - Software 5 05-03-2004 05:14 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:11 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration