wood burning stoves 2.0*
The moose likes Servlets and the fly likes Tomcat 4.0.1  - Servlet not found Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Tomcat 4.0.1  - Servlet not found" Watch "Tomcat 4.0.1  - Servlet not found" New topic
Author

Tomcat 4.0.1 - Servlet not found

Francois Bourgault
Ranch Hand

Joined: Oct 30, 2001
Posts: 67
Hi all,
I just installed tomcat 4.0.1 and copied all source code and classes under webapps\myServlets. In tomcat 3, I had everything under examples. Now I want to create my own subdirectory. I followed directives from the next link: http://www.javaranch.com/ubb/Forum7/HTML/005712.html
When I try to execute my servlet using : http://localhost:8080/myServlets/HelloServlet
I get http status 404 - page not found
In server.xml, I added:
<Context path="/myServlets" docBase="webapps/myServlets"
debug="0" privileged="true"/>
And in web.xml, I added:
<servlet>
<servlet-name>HelloServlet</servlet-name>
<servlet-class>HelloServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>HelloServlet</servlet-name>
<url-pattern>/HelloServlet</url-pattern>
</servlet-mapping>
Main directory is: c:\apache\jakarta-tomcat
I have created "myServlets" directory in web-apps. My structure is:
jakarta-tomcat
---- webapps
---- admin
---- examples
---- myServlets
--------- images
-------- META-INF
-------- WEB-INF\HelloServlet.class
---- ROOT
Can someone tell me what I'm missing?
Thanks,
Francois.
Tony Alicea
Desperado
Sheriff

Joined: Jan 30, 2000
Posts: 3222
    
    5
-------- WEB-INF\classes\HelloServlet.class


Tony Alicea
Senior Java Web Application Developer, SCPJ2, SCWCD
Francois Bourgault
Ranch Hand

Joined: Oct 30, 2001
Posts: 67
Hi all,
I forgot to mention that I created javabeans and copied the class file in myServlets\web-inf When I run jsp pages, I get the following error:
An error occurred at line: 19 in the jsp file: /list_guests.jsp
Generated servlet error:
C:\Apache\jakarta-tomcat\work\localhost\Src\list_0005fguests$jsp.java:91: Class org.apache.jsp.Guest_Bean not found.
formhandler = (Guest_Bean) java.beans.Beans.instantiate(this.getClass().getClassLoader(), "Guest_Bean");

Is this also related to my previous posting?
Francois.
Francois Bourgault
Ranch Hand

Joined: Oct 30, 2001
Posts: 67
Tony,
My mistake. It is in: WEB-INF\classes\HelloServlet.class
Francois
Francois Bourgault
Ranch Hand

Joined: Oct 30, 2001
Posts: 67
Tony,
My mistake. It is in: WEB-INF\classes\HelloServlet.class
Francois
Francois Bourgault
Ranch Hand

Joined: Oct 30, 2001
Posts: 67
Hi all,
I fixed the problem with servlets. Now I can execute a servlet. BUT I still can't create an instance of a bean in jsp page. It says:
An error occurred at line: 19 in the jsp file: /list_guests.jsp
Generated servlet error:
C:\Apache\jakarta-tomcat\work\localhost\Src\list_0005fguests$jsp.java:91: Class org.apache.jsp.Guest_Bean not found.
formhandler = (Guest_Bean) java.beans.Beans.instantiate(this.getClass().getClassLoader(), "Guest_Bean");
What cause that? Any idea..
FYI: I can run jsp files without javabeans.
Also, the bean is registered in web.xml
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Tomcat 4.0.1 - Servlet not found