java servlet newbie problem

Discussion in 'Java' started by lasse_heinonen7@hotmail.com, Jul 14, 2006.

  1. Guest

    Hi, I can't get my Java servlets to work. Tomcat-4.1.31 and the example
    servlets work fine.
    I have added my own context "eka" under webapps.
    The code builds ok:

    package paketti1;
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;

    public class Eka1 extends HttpServlet {

    public void doGet ( HttpServletRequest request,
    HttpServletResponse response )
    throws ServletException, IOException {

    response.setContentType("text/html");
    PrintWriter out = response.getWriter();

    out.println("<html>");
    out.println("<head><title>He llo, Cruel
    World!</title></head>");
    out.println("<body>");
    out.println("<h1>Hello, Cruel World !</h1>");
    out.println("This is my last servlet.");
    out.println("</body>");
    }// end doGet

    }///:~


    This is what I have added to server.xml:
    <Context path="/eka" docBase="eka" debug="0" reloadable="true" />

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

    <!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>

    <servlet>
    <servlet-name>Eka1</servlet-name>
    <servlet-class>paketti1.Eka1</servlet-class>
    </servlet>

    <servlet-mapping>
    <servlet-name>Eka1</servlet-name>
    <url-pattern>/Eka1</url-pattern>
    </servlet-mapping>

    </web-app>

    My class file is here:
    /usr/local/jakarta-tomcat-4.1.31/webapps/eka/WEB-INF/classes/paketti1

    I put this to address bar http://localhost:8080/eka/Eka1
    and I received an error message:

    HTTP Status 500 -

    type Exception report

    message

    description The server encountered an internal error () that prevented
    it from fulfilling this request.

    exception

    javax.servlet.ServletException: Wrapper cannot find servlet class
    paketti1.Eka1 or a class it depends on
    at
    org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:844)
    at
    org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:621)
    at
    org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:163)
    at
    org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
    at
    org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
    at
    org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
    at
    org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:144)
    at
    org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
    at
    org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
    at
    org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
    at
    org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2358)
    at
    org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:133)
    at
    org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
    at
    org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:118)
    at
    org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:594)
    at
    org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:116)
    at
    org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:594)
    at
    org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
    at
    org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
    at
    org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:127)
    at
    org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
    at
    org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
    at
    org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
    at
    org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:152)
    at
    org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
    at
    org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
    at
    org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
    at
    org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
    at java.lang.Thread.run(Thread.java:595)

    root cause

    java.lang.ClassNotFoundException: paketti1.Eka1
    at
    org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1407)
    at
    org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1252)
    at
    org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:838)
    at
    org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:621)
    at
    org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:163)
    at
    org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
    at
    org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
    at
    org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
    at
    org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:144)
    at
    org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
    at
    org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
    at
    org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
    at
    org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2358)
    at
    org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:133)
    at
    org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
    at
    org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:118)
    at
    org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:594)
    at
    org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:116)
    at
    org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:594)
    at
    org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
    at
    org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
    at
    org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:127)
    at
    org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
    at
    org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
    at
    org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
    at
    org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:152)
    at
    org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
    at
    org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
    at
    org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
    at
    org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
    at java.lang.Thread.run(Thread.java:595)

    Apache Tomcat/4.1.31

    What have I done wrong?
    Regars Lasse
    , Jul 14, 2006
    #1
    1. Advertising

  2. Greger Guest

    wrote:

    > Hi, I can't get my Java servlets to work. Tomcat-4.1.31 and the example
    > servlets work fine.
    > I have added my own context "eka" under webapps.
    > The code builds ok:
    >
    > package paketti1;
    > import java.io.*;
    > import javax.servlet.*;
    > import javax.servlet.http.*;
    >
    > public class Eka1 extends HttpServlet {
    >
    > public void doGet ( HttpServletRequest request,
    > HttpServletResponse response )
    > throws ServletException, IOException {
    >
    > response.setContentType("text/html");
    > PrintWriter out = response.getWriter();
    >
    > out.println("<html>");
    > out.println("<head><title>He llo, Cruel
    > World!</title></head>");
    > out.println("<body>");
    > out.println("<h1>Hello, Cruel World !</h1>");
    > out.println("This is my last servlet.");
    > out.println("</body>");
    > }// end doGet
    >
    > }///:~
    >
    >
    > This is what I have added to server.xml:
    > <Context path="/eka" docBase="eka" debug="0" reloadable="true" />
    >
    > my web.xml:
    > <?xml version="1.0" encoding="ISO-8859-1"?>
    >
    > <!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>
    >
    > <servlet>
    > <servlet-name>Eka1</servlet-name>
    > <servlet-class>paketti1.Eka1</servlet-class>
    > </servlet>
    >
    > <servlet-mapping>
    > <servlet-name>Eka1</servlet-name>

    ====>>> <url-pattern>/Eka1</url-pattern>


    > </servlet-mapping>
    >
    > </web-app>
    >
    > My class file is here:
    > /usr/local/jakarta-tomcat-4.1.31/webapps/eka/WEB-INF/classes/paketti1


    >
    > I put this to address bar http://localhost:8080/eka/Eka1


    try
    http://localhost:8080/Eka1


    Greger
    > and I received an error message:
    >
    > HTTP Status 500 -
    >
    > type Exception report
    >
    > message
    >
    > description The server encountered an internal error () that prevented
    > it from fulfilling this request.
    >
    > exception
    >
    > javax.servlet.ServletException: Wrapper cannot find servlet class
    > paketti1.Eka1 or a class it depends on
    > at
    >

    org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:844)
    > at
    >

    org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:621)
    > at
    >

    org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:163)
    > at
    > org.apache.catalina.core.StandardPipelin

    $StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
    > at
    >

    org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
    > at
    > org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
    > at
    >

    org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:144)
    > at
    > org.apache.catalina.core.StandardPipelin

    $StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
    > at
    >

    org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
    > at
    > org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
    > at
    > org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2358)
    > at
    >

    org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:133)
    > at
    > org.apache.catalina.core.StandardPipelin

    $StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
    > at
    >

    org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:118)
    > at
    > org.apache.catalina.core.StandardPipelin

    $StandardPipelineValveContext.invokeNext(StandardPipeline.java:594)
    > at
    >

    org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:116)
    > at
    > org.apache.catalina.core.StandardPipelin

    $StandardPipelineValveContext.invokeNext(StandardPipeline.java:594)
    > at
    >

    org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
    > at
    > org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
    > at
    >

    org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:127)
    > at
    > org.apache.catalina.core.StandardPipelin

    $StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
    > at
    >

    org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
    > at
    > org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
    > at
    > org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:152)
    > at
    > org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
    > at
    > org.apache.coyote.http11.Http11Protoco

    $Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
    > at
    > org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
    > at
    > org.apache.tomcat.util.threads.ThreadPoo

    $ControlRunnable.run(ThreadPool.java:683)
    > at java.lang.Thread.run(Thread.java:595)
    >
    > root cause
    >
    > java.lang.ClassNotFoundException: paketti1.Eka1
    > at
    >

    org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1407)
    > at
    >

    org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1252)
    > at
    >

    org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:838)
    > at
    >

    org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:621)
    > at
    >

    org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:163)
    > at
    > org.apache.catalina.core.StandardPipelin

    $StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
    > at
    >

    org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
    > at
    > org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
    > at
    >

    org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:144)
    > at
    > org.apache.catalina.core.StandardPipelin

    $StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
    > at
    >

    org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
    > at
    > org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
    > at
    > org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2358)
    > at
    >

    org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:133)
    > at
    > org.apache.catalina.core.StandardPipelin

    $StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
    > at
    >

    org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:118)
    > at
    > org.apache.catalina.core.StandardPipelin

    $StandardPipelineValveContext.invokeNext(StandardPipeline.java:594)
    > at
    >

    org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:116)
    > at
    > org.apache.catalina.core.StandardPipelin

    $StandardPipelineValveContext.invokeNext(StandardPipeline.java:594)
    > at
    >

    org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
    > at
    > org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
    > at
    >

    org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:127)
    > at
    > org.apache.catalina.core.StandardPipelin

    $StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
    > at
    >

    org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
    > at
    > org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
    > at
    > org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:152)
    > at
    > org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
    > at
    > org.apache.coyote.http11.Http11Protoco

    $Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
    > at
    > org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
    > at
    > org.apache.tomcat.util.threads.ThreadPoo

    $ControlRunnable.run(ThreadPool.java:683)
    > at java.lang.Thread.run(Thread.java:595)
    >
    > Apache Tomcat/4.1.31
    >
    > What have I done wrong?
    > Regars Lasse

    --
    QxRSSReader v1.2.6a released (30-06-2006)
    http://www.gregerhaga.net/
    There are no stupid questions, only stupid answers.
    Greger, Jul 14, 2006
    #2
    1. Advertising

  3. Guest

    This didn't help:
    HTTP Status 404 - /Eka1

    type Status report

    message /Eka1

    description The requested resource (/Eka1) is not available.
    Apache Tomcat/4.1.31


    Greger kirjoitti:

    > wrote:
    >
    > > Hi, I can't get my Java servlets to work. Tomcat-4.1.31 and the example
    > > servlets work fine.
    > > I have added my own context "eka" under webapps.
    > > The code builds ok:
    > >
    > > package paketti1;
    > > import java.io.*;
    > > import javax.servlet.*;
    > > import javax.servlet.http.*;
    > >
    > > public class Eka1 extends HttpServlet {
    > >
    > > public void doGet ( HttpServletRequest request,
    > > HttpServletResponse response )
    > > throws ServletException, IOException {
    > >
    > > response.setContentType("text/html");
    > > PrintWriter out = response.getWriter();
    > >
    > > out.println("<html>");
    > > out.println("<head><title>He llo, Cruel
    > > World!</title></head>");
    > > out.println("<body>");
    > > out.println("<h1>Hello, Cruel World !</h1>");
    > > out.println("This is my last servlet.");
    > > out.println("</body>");
    > > }// end doGet
    > >
    > > }///:~
    > >
    > >
    > > This is what I have added to server.xml:
    > > <Context path="/eka" docBase="eka" debug="0" reloadable="true" />
    > >
    > > my web.xml:
    > > <?xml version="1.0" encoding="ISO-8859-1"?>
    > >
    > > <!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>
    > >
    > > <servlet>
    > > <servlet-name>Eka1</servlet-name>
    > > <servlet-class>paketti1.Eka1</servlet-class>
    > > </servlet>
    > >
    > > <servlet-mapping>
    > > <servlet-name>Eka1</servlet-name>

    > ====>>> <url-pattern>/Eka1</url-pattern>
    >
    >
    > > </servlet-mapping>
    > >
    > > </web-app>
    > >
    > > My class file is here:
    > > /usr/local/jakarta-tomcat-4.1.31/webapps/eka/WEB-INF/classes/paketti1

    >
    > >
    > > I put this to address bar http://localhost:8080/eka/Eka1

    >
    > try
    > http://localhost:8080/Eka1
    >
    >
    > Greger
    > > and I received an error message:
    > >
    > > HTTP Status 500 -
    > >
    > > type Exception report
    > >
    > > message
    > >
    > > description The server encountered an internal error () that prevented
    > > it from fulfilling this request.
    > >
    > > exception
    > >
    > > javax.servlet.ServletException: Wrapper cannot find servlet class
    > > paketti1.Eka1 or a class it depends on
    > > at
    > >

    > org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:844)
    > > at
    > >

    > org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:621)
    > > at
    > >

    > org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:163)
    > > at
    > > org.apache.catalina.core.StandardPipelin

    > $StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
    > > at
    > >

    > org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
    > > at
    > > org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
    > > at
    > >

    > org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:144)
    > > at
    > > org.apache.catalina.core.StandardPipelin

    > $StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
    > > at
    > >

    > org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
    > > at
    > > org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
    > > at
    > > org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2358)
    > > at
    > >

    > org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:133)
    > > at
    > > org.apache.catalina.core.StandardPipelin

    > $StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
    > > at
    > >

    > org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:118)
    > > at
    > > org.apache.catalina.core.StandardPipelin

    > $StandardPipelineValveContext.invokeNext(StandardPipeline.java:594)
    > > at
    > >

    > org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:116)
    > > at
    > > org.apache.catalina.core.StandardPipelin

    > $StandardPipelineValveContext.invokeNext(StandardPipeline.java:594)
    > > at
    > >

    > org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
    > > at
    > > org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
    > > at
    > >

    > org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:127)
    > > at
    > > org.apache.catalina.core.StandardPipelin

    > $StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
    > > at
    > >

    > org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
    > > at
    > > org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
    > > at
    > > org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:152)
    > > at
    > > org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
    > > at
    > > org.apache.coyote.http11.Http11Protoco

    > $Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
    > > at
    > > org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
    > > at
    > > org.apache.tomcat.util.threads.ThreadPoo

    > $ControlRunnable.run(ThreadPool.java:683)
    > > at java.lang.Thread.run(Thread.java:595)
    > >
    > > root cause
    > >
    > > java.lang.ClassNotFoundException: paketti1.Eka1
    > > at
    > >

    > org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1407)
    > > at
    > >

    > org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1252)
    > > at
    > >

    > org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:838)
    > > at
    > >

    > org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:621)
    > > at
    > >

    > org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:163)
    > > at
    > > org.apache.catalina.core.StandardPipelin

    > $StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
    > > at
    > >

    > org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
    > > at
    > > org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
    > > at
    > >

    > org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:144)
    > > at
    > > org.apache.catalina.core.StandardPipelin

    > $StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
    > > at
    > >

    > org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
    > > at
    > > org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
    > > at
    > > org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2358)
    > > at
    > >

    > org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:133)
    > > at
    > > org.apache.catalina.core.StandardPipelin

    > $StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
    > > at
    > >

    > org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:118)
    > > at
    > > org.apache.catalina.core.StandardPipelin

    > $StandardPipelineValveContext.invokeNext(StandardPipeline.java:594)
    > > at
    > >

    > org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:116)
    > > at
    > > org.apache.catalina.core.StandardPipelin

    > $StandardPipelineValveContext.invokeNext(StandardPipeline.java:594)
    > > at
    > >

    > org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
    > > at
    > > org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
    > > at
    > >

    > org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:127)
    > > at
    > > org.apache.catalina.core.StandardPipelin

    > $StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
    > > at
    > >

    > org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
    > > at
    > > org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
    > > at
    > > org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:152)
    > > at
    > > org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
    > > at
    > > org.apache.coyote.http11.Http11Protoco

    > $Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
    > > at
    > > org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
    > > at
    > > org.apache.tomcat.util.threads.ThreadPoo

    > $ControlRunnable.run(ThreadPool.java:683)
    > > at java.lang.Thread.run(Thread.java:595)
    > >
    > > Apache Tomcat/4.1.31
    > >
    > > What have I done wrong?
    > > Regars Lasse

    > --
    > QxRSSReader v1.2.6a released (30-06-2006)
    > http://www.gregerhaga.net/
    > There are no stupid questions, only stupid answers.
    , Jul 14, 2006
    #3
  4. Juha Laiho Guest

    said:
    >Hi, I can't get my Java servlets to work. Tomcat-4.1.31 and the example
    >servlets work fine.
    >I have added my own context "eka" under webapps.


    Pretty much everything seems ok.

    >The code builds ok:
    >
    >package paketti1;
    >import java.io.*;
    >import javax.servlet.*;
    >import javax.servlet.http.*;
    >
    >public class Eka1 extends HttpServlet {


    I suppose the generated class file is named Eka1.class (note the capital
    E in the file name)?

    >This is what I have added to server.xml:
    ><Context path="/eka" docBase="eka" debug="0" reloadable="true" />


    Looks good. You could try increasing the debug level, though.

    >My class file is here:
    >/usr/local/jakarta-tomcat-4.1.31/webapps/eka/WEB-INF/classes/paketti1


    Seems correct. Does the Tomcat runtime account (so, the user account
    under which you're running the tomcat processes) have at least read
    access to everything within webapps/eka?

    >javax.servlet.ServletException: Wrapper cannot find servlet class
    >paketti1.Eka1 or a class it depends on


    .... I wonder where/why this happens. The error message is clear, at
    least.
    --
    Wolf a.k.a. Juha Laiho Espoo, Finland
    (GC 3.0) GIT d- s+: a C++ ULSH++++$ P++@ L+++ E- W+$@ N++ !K w !O !M V
    PS(+) PE Y+ PGP(+) t- 5 !X R !tv b+ !DI D G e+ h---- r+++ y++++
    "...cancel my subscription to the resurrection!" (Jim Morrison)
    Juha Laiho, Jul 20, 2006
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Andy Fish
    Replies:
    4
    Views:
    2,418
    Andy Fish
    Dec 17, 2003
  2. Sean Clarke
    Replies:
    1
    Views:
    1,893
    Sudsy
    Jan 7, 2004
  3. circuit_breaker
    Replies:
    2
    Views:
    1,997
    Jack Jia
    Apr 4, 2004
  4. chamikara
    Replies:
    1
    Views:
    49,866
  5. javadev
    Replies:
    5
    Views:
    12,908
    javadev
    Nov 16, 2006
Loading...

Share This Page