having problem loading a property file

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ndedhia1
    New Member
    • Jan 2009
    • 112

    having problem loading a property file

    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.FileNo tFoundException : /home/dedhia/.jftp/jftp.properties (No such file or directory))



    Here is my java code in which I get the property file:
    [code=java]
    String propertyFile = System.getPrope rty("Outlier.Pr opertyFile","OutlierReportGe nerator1.PROPER TIES");
    System.out.prin tln(propertyFil e);
    //Location of property file
    properties = new File(File.separ ator + "home" + File.separator + "dedhia" + File.separator + "OutlierReportG enerator" + File.separator + "classes" + File.separator + propertyFile);
    System.out.prin tln(properties) ;
    BufferedReader BR = new BufferedReader( new FileReader(prop erties));
    System.out.prin tln("I got to this pt");
    String line = BR.readLine();
    [/code]

    Here is the shell script where I run my program:
    [code=unix]
    /usr/local/jdk1.6.0_11/bin/java -Dreports="true" -Dmail="true" -Dconnect="true" -Dccserv="true" -DOutlier.Proper tyFile=OutlierR eportGenerator1 .properties -cl
    asspath /home/dedhia/OutlierReportGe nerator/classes:/home/dedhia/OutlierReportGe nerator/classes/jftp.jar:/home/dedhia/OutlierReportGe nerator/classes/jxl.jar:
    /home/dedhia/OutlierReportGe nerator/classes/produtil.jar:/home/dedhia/OutlierReportGe nerator/classes/activation.jar:/home/dedhia/OutlierReportGe nerator/class
    es/mail.jar:/home/dedhia/OutlierReportGe nerator/classes/classes12.zip:/home/dedhia/OutlierReportGe nerator/classes/OutlierReportGe nerator.jar ReportGenerator
    [/code]

    The OutlierReportGe nerator.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!!!
Working...