I have deployed a .war file (web-apps section) and in one of the class files in the .war, I read some data from a .xml file. But I get an error, file not found exception, .xml file not found.. What could be the problem? Thanks.......
you have to read like this InputStream in= this.getClass().getClassLoader().getResourceAsStream("your path would go here"); for eg the if your .java file is in packaget org.presci.transaction and your xml file is in same directory then the path would go something like this /org/presci/transaction/your.xml
Thanks for the reply Prasad, I got the problem, the war file was getting deployed in a specific path of the server, and to get that path, applicatin.getRealPath("") needs to be appended to the path specified in the java file. Thanks....
What's that smell? I think this tiny ad may have stepped in something.