By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,854 Members | 869 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,854 IT Pros & Developers. It's quick & easy.

having problem loading a property file

P: 112
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... ( /home/dedhia/.jftp/ (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();
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" -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/ ReportGenerator
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
Share this question for a faster answer!
Share on Google+

Post your reply

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