Win a copy of The Way of the Web Tester: A Beginner's Guide to Automating Tests this week in the Testing forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

cannot find resources

Michel de Lange
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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";
InputStream fstream = this.getClass().getResourceAsStream(fileName);
DataInputStream in = new DataInputStream(fstream);


And Tomcat never finds the file. I get:

at Source)
at sun.nio.cs.StreamDecoder.readBytes(Unknown Source)

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

Many thanks for your help,

  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic