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

[1988 byte] By [Husama] at [2007-11-26 13:35:07]
# 1
Try to specify the qualified path of the "daily.cfg " file (Full Path).RegardsVinay
cybervink2000a at 2007-7-7 22:17:47 > top of Java-index,Java Essentials,New To Java...
# 2
the problem if i specify the full path and want to move it to another machine it will generate an exception
Husama at 2007-7-7 22:17:47 > top of Java-index,Java Essentials,New To Java...
# 3
Otherwise you should keep the file under the folder where you are going to executing your program.OrUse any property file which contains the fully qualified path.So that you can modify it, when ever you needed.
cybervink2000a at 2007-7-7 22:17:47 > top of Java-index,Java Essentials,New To Java...