*
The moose likes Beginning Java and the fly likes FileInputStream error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "FileInputStream error" Watch "FileInputStream error" New topic
Author

FileInputStream error

sachin y deshpande
Greenhorn

Joined: May 12, 2004
Posts: 20
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

Joined: Jan 28, 2003
Posts: 4181
    
  21

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.


Steve
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: FileInputStream error