469,578 Members | 1,883 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,578 developers. It's quick & easy.

having problem loading a property file

112 100+
I am having trouble loading a property file and keep getting this error when running my shell script that loads and runs my jar files, etc:

no property file loaded, using defaults... (java.io.FileNotFoundException: /home/dedhia/.jftp/jftp.properties (No such file or directory))



Here is my java code in which I get the property file:
Expand|Select|Wrap|Line Numbers
  1.         String propertyFile = System.getProperty("Outlier.PropertyFile","OutlierReportGenerator1.PROPERTIES");
  2.         System.out.println(propertyFile);
  3. //Location of property file
  4.         properties = new File(File.separator + "home" + File.separator + "dedhia" + File.separator + "OutlierReportGenerator" + File.separator + "classes" + File.separator + propertyFile);
  5.         System.out.println(properties);
  6.         BufferedReader BR = new BufferedReader(new FileReader(properties));
  7.         System.out.println("I got to this pt");
  8.         String line = BR.readLine();
  9.  
Here is the shell script where I run my program:
Expand|Select|Wrap|Line Numbers
  1. /usr/local/jdk1.6.0_11/bin/java -Dreports="true" -Dmail="true" -Dconnect="true" -Dccserv="true" -DOutlier.PropertyFile=OutlierReportGenerator1.properties -cl
  2. asspath /home/dedhia/OutlierReportGenerator/classes:/home/dedhia/OutlierReportGenerator/classes/jftp.jar:/home/dedhia/OutlierReportGenerator/classes/jxl.jar:
  3. /home/dedhia/OutlierReportGenerator/classes/produtil.jar:/home/dedhia/OutlierReportGenerator/classes/activation.jar:/home/dedhia/OutlierReportGenerator/class
  4. es/mail.jar:/home/dedhia/OutlierReportGenerator/classes/classes12.zip:/home/dedhia/OutlierReportGenerator/classes/OutlierReportGenerator.jar ReportGenerator
  5.  
The OutlierReportGenerator.jar is the jar that I am exporting from eclipse, which contains all of my java code. Report Generator is the class in which main is at.

Am I doing something incorrect in the way that I am loading my property file because I have tried a few different things but seem to get the same error over and over again.

Thanks for the help!!!
Jan 8 '10 #1
0 1834

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by Joe | last post: by
10 posts views Thread by Randy Webb | last post: by
5 posts views Thread by Kurt Bauer | last post: by
4 posts views Thread by Mike | last post: by
2 posts views Thread by www.gerardvignes.com | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.