Win a copy of Kotlin in Action this week in the Kotlin forum!
  • 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  RSS feed

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(
at javax.servlet.http.HttpServlet.service(
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
at org.apache.catalina.core.ApplicationFilterChain.doFilter(
at org.apache.catalina.core.StandardWrapperValve.invoke(
at org.apache.catalina.core.StandardContextValve.invoke(
at org.apache.catalina.core.StandardHostValve.invoke(
at org.apache.catalina.valves.ErrorReportValve.invoke(
at org.apache.catalina.core.StandardEngineValve.invoke(
at org.apache.catalina.connector.CoyoteAdapter.service(
at org.apache.coyote.http11.Http11Processor.process(
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(
at Source)
package com.lala.servlets;
import javax.servlet.*;
import javax.servlet.http.*;
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: 18705
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 .

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!