tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Scott Purcell" <>
Subject init() block not initializing?
Date Fri, 06 Dec 2002 19:33:40 GMT

I am trying to get a servlet Initialization block to initialize but I cannot seem to get it
to work. I am running a new install of Tomcat 4.1.12 on win2000. 

I have created a webapp called "cybrary", and I have put that into the server xml with the
following line:
        <Context path="/cybrary" docBase="cybrary" debug="0"
                 reloadable="true" crossContext="true" />

Then I created the proper structure under webapps eg:

The code I am running is here, there is nothing to it, just want it to hit the init block.
When I run it with the following url: http://localhost:8080/cybrary/servlet/CybraryRPCHandler
the out.println message shows, but no init ever. I am printing that to stdout, in which I
never see any print.

Does anyone know why this would occur.

Also, in case needed the web.xml is below all of this:

package com.ddi.ags.rpc;

import java.util.*;
import javax.servlet.*;
import javax.servlet.http.*;
import org.apache.xmlrpc.*;
public class CybraryRPCHandler extends HttpServlet {
    public void init() throws ServletException {
	System.out.println("IN the init");

    public void doGet(HttpServletRequest request,
		      HttpServletResponse response)
	throws ServletException, IOException {
	PrintWriter out = response.getWriter();
	out.println("this is another attempt at the init firing up.");

#### web.xml ######
<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"






To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message