wood burning stoves 2.0*
The moose likes Tomcat and the fly likes Problem with Apache Tomcat 5.5.12 and calling Servlets Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Products » Tomcat
Reply locked New topic
Author

Problem with Apache Tomcat 5.5.12 and calling Servlets

Kevin P Smith
Ranch Hand

Joined: Feb 18, 2005
Posts: 362
Hi guys, hope you can help...

I have two Servlets, one called LoginServlet & another called UploadServlet.

The problem I am having is, whilst my program will call/run the LoginServlet fine. When I
come to calling the UploadServlet, I get the following page error:

HTTP Status 404 - /admin/secure/uploader/UploadServlet
--------------------------------------------------------------------------------
type Status report
message /admin/secure/uploader/UploadServlet
description The requested resource (/admin/secure/uploader/UploadServlet) is not available.
--------------------------------------------------------------------------------
Apache Tomcat/5.5.12

There appears to be no error in the Tomcat logs to help explain what is going on. It's just like the Servlet class just isn;t
physically there (obviously it is).

Could someone help, it's really holding me up at the moment.

(Below are some details of file locations and stuff to help you out).

JSP location:
C:\Java\Tomcat 5.5\webapps\web\secure\uploader\upload.jsp

Form that calls Servlet:
<form name="frmUploader" action="UploadServlet" method="POST">

Servlet package:
package uk.co.domain.servlets;

Servlet class location:
C:\Java\Tomcat 5.5\webapps\web\WEB-INF\classes\uk\co\domain\servlets\UploadServlet.class

web.xml location:
C:\Java\Tomcat 5.5\webapps\web\WEB-INF\web.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app id="WebApp_1136308273688">
<servlet id="Servlet_1136308272594">
<servlet-name>LoginServlet</servlet-name>
<servlet-class>uk.co.domain.servlets.LoginServlet</servlet-class>
</servlet>
<servlet id="Servlet_1136308272595">
<servlet-name>UploadServlet</servlet-name>
<servlet-class>uk.co.domain.servlets.UploadServlet</servlet-class>
</servlet>

<servlet-mapping id="ServletMapping_1136308273704">
<servlet-name>LoginServlet</servlet-name>
<url-pattern>/LoginServlet</url-pattern>
</servlet-mapping>
<servlet-mapping id="ServletMapping_1136308273705">
<servlet-name>UploadServlet</servlet-name>
<url-pattern>/UploadServlet</url-pattern>
</servlet-mapping>

<welcome-file-list id="WelcomeFileList_1136308273703">
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>
Amit Kumar Kaushik
Greenhorn

Joined: Jan 12, 2006
Posts: 11
change the folloing line and try again.

<form name="frmUploader" action="http:\\localhost:8080\web\UploadServlet" method="POST">


or



<form name="frmUploader" action="/web/UploadServlet" method="POST">
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

K Secker,

Please don't ask the same question multiple times in the same forum.
If the details from your first thread have changed, update that one.

Please continue this conversation in the original thread:
http://www.coderanch.com/t/85684/Tomcat/Tomvat-having-trouble-finding-Servlets


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem with Apache Tomcat 5.5.12 and calling Servlets