deploying WARs

Posted on 2003-03-02
Medium Priority
Last Modified: 2010-04-20
hi - i am starting SCWCD study and am having trouble deploying servlets. Using Tomcat 4.1.18 on w2k pro under jdk1.4.1

ide is forte studio 4 U1 and jdev 9 (same problem when using either)

i created a really trivial servlet and a web.xml then deployed the WAR (as webapp1.war) to the webapps folder.

this is the web.xml
<?xml version = '1.0' encoding = 'windows-1252'?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
  <description>Empty web.xml file for Web Application</description>

this is servlet1
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.PrintWriter;
import java.io.IOException;

public class Servlet1 extends HttpServlet
     private static final String CONTENT_TYPE = "text/html; charset=windows-1252";

     public void init(ServletConfig config) throws ServletException

     public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
          PrintWriter out = response.getWriter();
          out.println("<p>The servlet has received a GET. This is the reply.</p>");
there is also an HTML file at the same level as the WEB-INF folder (which contains the classes folder and within that the servlet class)

i deployed this to the webapps folder as a built WAR and i can browse to the HTML file with http://localhost:8080/webapp1/testhtml.html but http://localhost:8080/webapp1/servlet/Servlet1 fails with a not found error.
if i drop this servlet class into one of the Tomcat example folders, it works, so i know the servlet class isnt corrupt - can anyone give me any advice ?


Question by:simonm99
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2

Accepted Solution

NetWize earned 400 total points
ID: 8063001
I guess you need a


below the <servlet>.

Another way to solve that would be to enable the Invoker-Servlet in server.xml in your tomcat /conf directory

Author Comment

ID: 8068567
yes, perhaps - you see the web.xml was generated automatically so I'm learning something here. I'll try it and report, thanks

Author Comment

ID: 8073477
thanks - i cant find a way to make JDev do this automatically so i'll have to add it manually for now.

i will investiage the invoker-servlet point also.

Featured Post

Create the perfect environment for any meeting

You might have a modern environment with all sorts of high-tech equipment, but what makes it worthwhile is how you seamlessly bring together the presentation with audio, video and lighting. The ATEN Control System provides integrated control and system automation.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A web service (http://en.wikipedia.org/wiki/Web_service) is a software related technology that facilitates machine-to-machine interaction over a network. This article helps beginners in creating and consuming a web service using the ColdFusion Ma…
Have you ever sent email via ColdFusion and thought of tracking this mail to capture the exact date and time when the message was opened ?  If yes, then this article is for you ! First we need a table user_email with columns user_id , email , sub…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Suggested Courses
Course of the Month13 days, 4 hours left to enroll

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question