File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

FileInputStream error

 
sachin y deshpande
Greenhorn
Posts: 20
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
We are trying to read a properties file using FileInputStream in our j2ee app:


The properties file is in a jar defined as a utility jar within the server and associated with the app.

We are getting the following error





Funnily we get the file if we use Resource bundle to load the file.

Please help.
 
Steve Luke
Bartender
Pie
Posts: 4181
21
IntelliJ IDE Java Python
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The FileInputStream will be looking for the file as a Real File, in the JVM's active directory (wherever that happens to be). It does not look through the classpath, and I don't think it will open a file from a JAR file either.

The resource bundle is the proper route to go here.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic