• Post Reply Bookmark Topic Watch Topic
  • New Topic

http status 500 error in tomcat 6,when i try to run a simple login servlet for entering name & pwd

narayan ks
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


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



Dec 26, 2012 1:16:18 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet LoginServlet threw exception
at com.lala.servlets.LoginServlet.service(LoginServlet.java:14)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
at java.lang.Thread.run(Unknown Source)
package com.lala.servlets;
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
public class LoginServlet extends HttpServlet{
public void init(ServletConfig sc){
System.out.println("init() login servlet");
public void service(HttpServletRequest req,HttpServletResponse res)throws IOException,ServletException{
System.out.println("service() login servlet");
String un=req.getParameter("username");
String pw=req.getParameter("password");
String msg=" ";
msg="Hello"+un+"!your login is sucessful";
msg="hello"+un+"!your login failed";
PrintWriter out=res.getWriter();
System.out.println("<fontsize=6 color=red>"+msg+"<font>");
public void destroy(){
System.out.println("destroy() login servlet");
Tim Holloway
Posts: 18408
Android Eclipse IDE Linux
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Narayan ks",

We don't have many rules here at the JavaRanch, but we do insist that you use your Real Name and not some sort of "handle" or obvious alias. If you're not sure about this, see
http://www.javaranch.com/name.jsp .

I make it a policy not to answer questions until people have their display names in order, but I will say that this is not a Tomcat problem. You have an error in your code which will fail on any J2EE server, not just Tomcat. And provided one more example why it's not a good idea to write your own login/security code.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!