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

Applet can't find Servlet file

Hal Poyta
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm writing an applet that uses servlets to access files on the server (which is a unix machine). The first servlet executes fine (It is used to get default information for the client to manipulate), but the next servlet to be called throws a File Not Found Exception even though it is located in the same directory as the first Servlet. The path name of the file it is looking for is spelled correctly.

these are the objects used in the code shown below
webServerStr -- String
MapServlet -- URL
serConn -- URLConnection
out -- ObjectOutputStream
in -- ObjectInputStream
location -- MapURL (object that gets returned from Servlet)
ma -- MapAttributes (object that gets sent to Servlet)

this is in the try portion of the code that calls the Servlet that throws the File Not Found Exception:
webServerStr = "";

MapServlet = new URL(webServerStr);
servCon = MapServlet.openConnection();
out = new ObjectOutputStream(servCon.getOutputStream());

in = new ObjectInputStream(servCon.getInputStream());
location = (MapURL)in.readObject();
the servlet that runs correctly is called using the exact same code as above except MapServlet is called DefaultServlet (for URL Object as well as filename in webServerStr) and the objects sent and returned are different. Both Servlets also have the same permission set for them - R & W for owner and R for the rest.
The actual error recieved is this: at
changing the URL to servlets/MapServlet still gives me the same error:
If anyone knows what's wrong or can give me any ideas as to why this is happening it would really be appreciated.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic