Results 1 to 3 of 3
  1. #1
    gauravmanral's Avatar
    gauravmanral is offline Gaurav Manral
    Join Date
    Jul 2011
    Location
    Delhi
    Posts
    37
    Rep Power
    0

    Question HTTP Status 500 -

    hello everyone...

    i have run a servlet application on weblogic server successfully.
    but getting this error when i'm running it on tomcat server....

    this is error...

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

    exception

    javax.servlet.ServletException: Wrapper cannot find servlet class MyServlet or a class it depends on


    root cause

    java.lang.ClassNotFoundException: MyServlet





    my Servlet program is.....

    MyServlet.java

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

    public class MyServlet extends HttpServlet
    {

    public void service(HttpServletRequest req,HttpServletResponse res) throws ServletException, IOException
    {
    res.setContentType("text/html");
    PrintWriter out=res.getWriter();
    String name=req.getParameter("txtname");
    out.println("<center><b> Hello "+name+"</b></center>");
    }

    }



    index.html

    <html>
    <body>
    <form action="Servlet1" method="get">
    name:<input type="text" name="txtname" value="enter ur name"/>
    <br> <input type="submit" name="btsubmit" value="submit" />
    </form>
    </body>
    </html>


    web.xml

    <web-app>
    <servlet>
    <servlet-name>test</servlet-name>
    <servlet-class>MyServlet</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>test</servlet-name>
    <url-pattern>/Servlet1</url-pattern>
    </servlet-mapping>
    </web-app>

  2. #2
    doWhile is offline Moderator
    Join Date
    Jul 2010
    Location
    California
    Posts
    1,642
    Rep Power
    7

    Default Re: HTTP Status 500 -

    How are you trying to access the servlet? In other words, are you sure you are using the correct URL to the servlet as specified in the web.xml

  3. #3
    gauravmanral's Avatar
    gauravmanral is offline Gaurav Manral
    Join Date
    Jul 2011
    Location
    Delhi
    Posts
    37
    Rep Power
    0

    Default Re: HTTP Status 500 -

    yes, i'm sure...
    well i have done it..i don't know how..i restarted the computer & it worked...:)
    i think, as i did HOT DEPLOYMENT..& may be it needs to be restarted after deployment...

Similar Threads

  1. http status 500
    By sudha333 in forum Advanced Java
    Replies: 11
    Last Post: 05-09-2011, 02:41 PM
  2. HTTP Status 500 -
    By aiesha in forum JavaServer Pages (JSP) and JSTL
    Replies: 1
    Last Post: 03-23-2011, 04:16 AM
  3. http://localhost:8080/helloservice/HelloService?Tester HTTP Status 404 -
    By vietnamusa in forum Enterprise JavaBeans (EJB)
    Replies: 0
    Last Post: 03-13-2011, 12:02 AM
  4. http status 500
    By swathi dharmaraj in forum Java Servlet
    Replies: 4
    Last Post: 12-14-2010, 04:46 PM
  5. Replies: 7
    Last Post: 11-11-2009, 08: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
  •