Got problem in tomcat while read xml file..
hi' i just wondering, why i always got his exception, i just want to read this file
java.io.FileNotFoundException: C:\Program Files\netbeans-5.5\enterprise3\apache-tomcat-5.5.17\bin\dbconfig.xml (The system cannot find the file specified)
at java.io.FileInputStream.open(Native Method)......
How to read dbconfig.xml?
Right now i put dbconfig.xml in /webapps/myapp/web-inf/classes/dbconfig.xml. but i always got that exception, why?
if i put my dbconfig.xml inapache-tomcat-5.5.17\bin directory (see exception...), i got no exception.
So, is there anyway to read dbconfig.xml while i put it in/webapps/myapp/web-inf/classes/ directory?
This is my code :
public UserWrapper(){
builder =new SAXBuilder();
try{
doc = builder.build(new File("dbconfig.xml"));
rootElement = doc.getRootElement();
System.out.println(rootElement.getChildText("db-driver"));
}catch (JDOMException e){
e.printStackTrace();
}catch (IOException e){
e.printStackTrace();
}
}
Thanks a lot..

