This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Applets and the fly likes Inconsistent FileNotFoundException Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Applets
Bookmark "Inconsistent FileNotFoundException" Watch "Inconsistent FileNotFoundException" New topic

Inconsistent FileNotFoundException

Vidya Ram
Ranch Hand

Joined: Apr 22, 2003
Posts: 62
I have a web server and a client applet to have chat functionality between server and client. If I run the applet on a different machine other than where the server is, it works just fine.
But if I try to run the applet from the same machine ie., http:\\localhost ort\chat.html, then applet fails to load and I get a series of for many of the library jar files.
Not only that, it has so many inconsistent behavior in different machines (but atleast it gets loaded in all those machines). BTW, its a signed applet.
I am really confused about this behavior of my applet... it will be really helpful if somebody can help me out in solving this problem.
Billybob Marshall
Ranch Hand

Joined: Jan 27, 2004
Posts: 202
My guess is you're using pathname-based URLs for your files rather than classpath-based ones.
For example, instead of:
InputStream s = Something.openStream("file name here");
you should use:
URL resource = getClass().getResource("file name here");
InputStream s = Something.openStream(resource);
subject: Inconsistent FileNotFoundException
Similar Threads
how to write into a property file from web browser
Testing On Multiple Platforms
steps to run an applet
printout from applet varies depending on server
singed applets (are policy files needed)