i have aproblem with executing the file
when i run my program from the IDE which is net beans 5 the program work successfully
when i run it from cmd or mak run.bat which contain
java -jar "Statistcs.jar" i get the following error
Exception in thread "main" java.io.FileNotFoundException: conf\daily.cfg (The sy
stem cannot find the path specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:106)
at java.io.FileInputStream.<init>(FileInputStream.java:66)
at comm.Caller.main(Caller.java:39)
the main class contain the following:
public static void main(String args[]) throws Exception
{
Properties prop = new Properties();// Deine new Properties.
prop.load(new FileInputStream("conf/daily.cfg"));//load the daily.cfg file .
FileInputStream in = new FileInputStream(new File("Portal/ETS_GBS_SMS_Orders.txt"));//get the Service Portal File.
PortalServiceWriter portal = new PortalServiceWriter(); //define new Service Portal Object;
portal.writePortalFile();// call the writePortal Function.
FTPClient ftp = new FTPClient(); //define new ftp client.
ftp.connect(prop.getProperty("host").trim(),21); // connect to the host
ftp.login(prop.getProperty("USERNAME").trim(),prop.getProperty("PASSWORD").trim());//login to the host by the user name and password
ftp.changeWorkingDirectory("/SP");// change the working direcoty to /SP/
//ftp.storeFile("ETS_GBS_SMS_Orders.txt",(InputStream)in); // upload the file in the directory.
ftp.logout();//log out from the host
in.close();// Close the connection to the stream file.
ExcelReader xls = new ExcelReader(); // define new object of the ExcelReader Type.
xls.ReadExcel();//call Read Excel File
}
the file daily.cfg in the file conf in the same directory of the project
please help me
Message was edited by:
Husam

