tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nicholas Orr <Nicholas....@mim.com.au>
Subject RE: Servlet messages to xconsole
Date Fri, 13 Sep 2002 05:40:56 GMT
Try modifying it to this.

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 doGet(ServletRequest request, ServletResponse response)
    throws ServletException, IOException {
    System.out.println("You got me.");
  }

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

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

}

-----Original Message-----
From: Mr Anand Parikh [mailto:anand_a_parikh@yahoo.com] 
Sent: Friday, 13 September 2002 1:34 PM
To: tomcat-user@jakarta.apache.org
Subject: 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.jav
a: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:
<mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail:
<mailto:tomcat-user-help@jakarta.apache.org>


**********************************************************************
The information contained in this e-mail is confidential and is
intended only for the use of the addressee(s).
If you receive this e-mail in error, any use, distribution or
copying of this e-mail is not permitted. You are requested to
forward unwanted e-mail and address any problems to the
MIM Holdings Limited Support Centre.

For general enquires:	++61 7 3833 8000
Support Centre e-mail:	supportcentre@mim.com.au
Support Centre phone:  	Australia 1800500646
        				International ++61 7 38338042
**********************************************************************


--
To unsubscribe, e-mail:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-user-help@jakarta.apache.org>


Mime
View raw message