You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Mr Anand Parikh <an...@yahoo.com> on 2002/09/13 05:33:44 UTC

Servlet messages to xconsole

I am running tomcat 4.0.4, JDK 1.3, Debian linux
2.2.6.
The following example is from the book "Java for the
Web with
Servlets, JSP, EJB" by Budi Kurniawan.
It should send messages to the xconsole but I get
errors.
I am stuck... any help is highly appreciated.

Thanks,
Anand


PrimitiveServlet.java:
-----------------------
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
import java.io.IOException;
import java.util.*;


public class PrimitiveServlet implements Servlet {

  public void init(ServletConfig config) throws
ServletException {
    System.out.println("init");
  }

  public void service(ServletRequest request,
ServletResponse
response)
    throws ServletException, IOException {
    System.out.println("service");
  }

  public void destroy() {
    System.out.println("destroy");
  }

  public String getServletInfo() {
    return null;
  }
  public ServletConfig getServletConfig() {
    return null;
  }

}


Netscape Error:
----------------
The document contained no data.
Try again later or contact the server's administrator.


Log file:
-----------
2002-09-12 17:30:20 
StandardWrapper[/myApp:org.apache.catalina.INVOKER.Primitive]:
Marking servlet org.apache.catalina.INVOKER.Primitive
as unavailable
2002-09-12 17:30:20 invoker: Cannot allocate servlet
instance for path
/myApp/servlet/Primitive/
javax.servlet.ServletException: Wrapper cannot find
servlet class
Primitive or a class it depends on

----- Root Cause -----
java.lang.ClassNotFoundException: Primitive
	at 
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1406)


web.xml:
---------
Since I don't have access to the internet on my Linux
machine, I have 
placed a copy of the DTD in a dir. I tried to access
the DTD using
both
of the following but I get the same error as mentioned
above:

http://java.sun.com/dtd/web-app_2_3.dtd
file://$CATALINA_HOME/webapps/myApp/web-app_2_3.dtd

__________________________________________________
Do you Yahoo!?
Yahoo! News - Today's headlines
http://news.yahoo.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>