aspose file tools*
The moose likes Servlets and the fly likes File not found error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "File not found error" Watch "File not found error" New topic
Author

File not found error

Cary Tanner
Greenhorn

Joined: Feb 08, 2005
Posts: 4
I'm brand new to servlets. I have a homepage, index.html and am trying to link to a servlet and I keep getting:

Error. The file was not found. (servlet name = java146.project2.First146Servlet)



Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

What app server are you using?


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Cary Tanner
Greenhorn

Joined: Feb 08, 2005
Posts: 4
ServletExec
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Hmm, I'm not familiar with that server but I know that in Tomcat, the invokerServlet is no longer active by default.

This means that you can no longer call servlets the way you are calling them
<p align=center><A HREF="/servlet/java146.project2.First146Servlet">Project2 Servlet</A></p>

You now need to map each servlet explitly in your web.xml file. Because this addresses a security issue, I wouldn't be surprized if ServletExec did the same thing.

Search the documentation for 'servlet-mapping'.

BTW: if you want some examples of mapped servlets you can get some at:
http://simple.souther.us
These are all packaged as war files so you should be able to deploy them pretty quickly to check the mapping issue.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: File not found error