This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Tomcat and the fly likes cannot find resources Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "cannot find resources" Watch "cannot find resources" New topic
Author

cannot find resources

Michel de Lange
Greenhorn

Joined: Jun 08, 2006
Posts: 1
I am sorry to trouble you folks with such a seemingly trivial problem, but I cannot work this out.

My servlet cannot find any of my resources (files). In my code, I have

String fileName= "infotext.html";
try{
InputStream fstream = this.getClass().getResourceAsStream(fileName);
DataInputStream in = new DataInputStream(fstream);


etc

And Tomcat never finds the file. I get:

java.lang.NullPointerException
at java.io.DataInputStream.read(Unknown Source)
at sun.nio.cs.StreamDecoder.readBytes(Unknown Source)



My file infotext.html is in WEB-INF/classes/ and for good measure also in
/WEB-INF/lib/resources.jar

Many thanks for your help,


Michel
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: cannot find resources
 
Similar Threads
JNLP applet to servlet communication problems -Directory Structure
Applet in JSP
ClassNotFoundException
My applet is not being seen in its jar anymore. Please help!
problem in rediredtin GUI to IO Streams