Results 1 to 16 of 16
  1. #1
    sini.sep87 is offline Member
    Join Date
    Nov 2009
    Posts
    10
    Rep Power
    0

    Unhappy HTTP Status 500 - type Exception report

    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 GreetServlet or a class it depends on
    org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:117)
    org.apache.catalina.connector.CoyoteAdapter.servic e(CoyoteAdapter.java:174)
    org.apache.coyote.http11.Http11Processor.process(H ttp11Processor.java:873)
    org.apache.coyote.http11.Http11BaseProtocol$Http11 ConnectionHandler.processConnection(Http11BaseProt ocol.java:665)
    org.apache.tomcat.util.net.PoolTcpEndpoint.process Socket(PoolTcpEndpoint.java:528)
    org.apache.tomcat.util.net.LeaderFollowerWorkerThr ead.runIt(LeaderFollowerWorkerThread.java:81)
    org.apache.tomcat.util.threads.ThreadPool$ControlR unnable.run(ThreadPool.java:689)
    java.lang.Thread.run(Unknown Source)
    root cause

    java.lang.ClassNotFoundException: GreetServlet
    org.apache.catalina.loader.WebappClassLoader.loadC lass(WebappClassLoader.java:1386)
    org.apache.catalina.loader.WebappClassLoader.loadC lass(WebappClassLoader.java:1232)
    org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:117)
    org.apache.catalina.connector.CoyoteAdapter.servic e(CoyoteAdapter.java:174)
    org.apache.coyote.http11.Http11Processor.process(H ttp11Processor.java:873)
    org.apache.coyote.http11.Http11BaseProtocol$Http11 ConnectionHandler.processConnection(Http11BaseProt ocol.java:665)
    org.apache.tomcat.util.net.PoolTcpEndpoint.process Socket(PoolTcpEndpoint.java:528)
    org.apache.tomcat.util.net.LeaderFollowerWorkerThr ead.runIt(LeaderFollowerWorkerThread.java:81)
    org.apache.tomcat.util.threads.ThreadPool$ControlR unnable.run(ThreadPool.java:689)
    java.lang.Thread.run(Unknown Source)
    note The full stack trace of the root cause is available in the Apache Tomcat/5.5.28 logs.

    Apache Tomcat/5.5.28

  2. #2
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    8

    Default

    As you can see from the trace, the class called GreetServlet has not been found at all by tomcat. Do you have it? Have you added it to your application's classes folder?
    P.S Better put your classes in packages rather than leaving them in the default package.

  3. #3
    sini.sep87 is offline Member
    Join Date
    Nov 2009
    Posts
    10
    Rep Power
    0

    Default

    thank u... i hav the class file in a folder called classes in web-inf... both classes folder n source folder r in web-inf... but still the error is class not found... y is it so??

  4. #4
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    8

    Default

    Put them in a package and also make sure their configuration is correct in the web.xml.

  5. #5
    sini.sep87 is offline Member
    Join Date
    Nov 2009
    Posts
    10
    Rep Power
    0

    Default

    i declared package now... but stil gettin the same error...
    this is the servlet mappin in web.xml



    <servlet>
    <servlet-name>Myservlet</servlet-name>
    <servlet-class>greet.GreetServlet</servlet-class>
    </servlet>

    <servlet-mapping>
    <servlet-name>Myservlet</servlet-name>
    <url-pattern>/greetme</url-pattern>
    </servlet-mapping>

    <!-- JSPC servlet mappings end -->

    </web-app>

  6. #6
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    8

    Default

    The error is still exactly the same?
    That means your package update wasn't picked.
    Stop the server, redeploy and start the server again.
    When the redeploy is complete, check the webapps folder for your application and see if the class is indeed in the correct folder.

  7. #7
    sini.sep87 is offline Member
    Join Date
    Nov 2009
    Posts
    10
    Rep Power
    0

    Default

    i restarted tomcat...... GreetServlet class file is a package called greet in classes folder..

    this is the error now


    HTTP Status 404 - Servlet Myservlet is not available

    type Status report

    message Servlet Myservlet is not available

    description The requested resource (Servlet Myservlet is not available) is not available.

    Apache Tomcat/5.5.28

  8. #8
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    8

    Default

    How are you accessing it?
    You should be accessing it using the mapping /greetme.
    Did you also verify the stuff I asked you check above?

  9. #9
    sini.sep87 is offline Member
    Join Date
    Nov 2009
    Posts
    10
    Rep Power
    0

    Default

    yup.. accessin thru mappin /greetme... class file is in the right folder...

  10. #10
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    8

    Default

    Use
    Java Code:
    ${pageContext.servletContext.contextPath}/greetme
    for the servlet path.

  11. #11
    sini.sep87 is offline Member
    Join Date
    Nov 2009
    Posts
    10
    Rep Power
    0

    Default

    i didnt get... where shud use dat code

  12. #12
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    8

    Default

    In the JSP that is trying to invoke the servlet.
    You are trying to invoke the servlet from a JSP, right?

  13. #13
    sini.sep87 is offline Member
    Join Date
    Nov 2009
    Posts
    10
    Rep Power
    0

    Default

    nope... its a simple servlet program... here is the code..

    package greet;
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.util.*;


    public class GreetServlet extends HttpServlet
    {
    public void doGet(HttpServletRequest req,HttpServletResponse res) throws IOException,ServletException
    {
    String name = req.getParameter("uname");
    String a = req.getParameter("age");
    int age = Integer.parseInt(a);

    PrintWriter out = res.getWriter();

    out.println("<html> Hello "+name+" how r u ");

    if(age<12)
    out.println("U r a chotu");
    else
    out.println("U r not a chotu </html>");
    }
    }

    and the html is
    XML Code:
    <html>
    <body bgcolor="blue">
    <form action=" " method="get">
    <h3>Name : <input type="text" name="uname">
    <br>
        Age  : <input type="text" age="age">
    <br>
               <input type="submit" value="Click me"></h3>
    </form>
    </body>
    </html>

  14. #14
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    8

    Default

    action=" " is not going to work. That page needs to be submitting to the servlet.
    Otherwise how are you calling the servlet at all?
    P.S Use the POST method if you are submitting data in the form for processing in the servlet.

  15. #15
    sini.sep87 is offline Member
    Join Date
    Nov 2009
    Posts
    10
    Rep Power
    0

    Default

    am not able to post urls here until i reach 20 posts so i left it blank.... actually i hav given the path.... am stil gettin the same error.... is der any mistake in servlet mapping?

    <web-app>

    <servlet>
    <servlet-name>myServlet</servlet-name>
    <servlet-class>greet.GreetServlet</servlet-class>
    </servlet>

    <servlet-mapping>
    <servlet-name>myServlet</servlet-name>
    <url-pattern>/greetme</url-pattern>
    </servlet-mapping>


    </web-app>

  16. #16
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    8

    Default

    Use action="${pageContext.servletContext.contextPath}/greetme".
    Make that page a JSP as well.

Similar Threads

  1. Replies: 7
    Last Post: 11-11-2009, 09:29 PM
  2. what does this means HTTP Status 500 -
    By gissah in forum New To Java
    Replies: 0
    Last Post: 03-28-2009, 04:27 AM
  3. Http Status 404 - LoginServlet.do
    By mbalas2 in forum Java Servlet
    Replies: 4
    Last Post: 03-05-2009, 06:52 PM
  4. problem with HTTP Status 404
    By orkun in forum JavaServer Faces (JSF)
    Replies: 1
    Last Post: 02-05-2009, 10:28 PM
  5. HTTP Status 404 - Servlet action is not available
    By onceuponatime in forum Java Servlet
    Replies: 1
    Last Post: 12-11-2007, 05:29 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •