Home Answers Viewqa JSP-Servlet http status 500 error in tomcat 6 while using eclipse helios

 
 


narayanks
http status 500 error in tomcat 6 while using eclipse helios
1 Answer(s)      3 months and 11 days ago
Posted in : JSP-Servlet

  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=" ";
        if(un.equals(pw)){
            msg="Hello"+un+"!your login is sucessful";
        }else{
            msg="hello"+un+"!your login failed";
        }
        res.setContentType("text/html");
        PrintWriter out=res.getWriter();
        System.out.println("<fontsize=6 color=red>"+msg+"<font>");
    }
    public void destroy(){
        System.out.println("destroy() login servlet");
    }
}

message

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

exception

java.lang.NullPointerException com.lala.servlets.LoginServlet.service(LoginServlet.java:14) javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

Dec 26, 2012 1:16:18 PM org.apache.catalina.core.StandardWrapperValve invoke SEVERE: Servlet.service() for servlet LoginServlet threw exception java.lang.NullPointerException 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)

View Answers

February 9, 2013 at 11:41 AM


Hello friend

First thing you need to correct is to add a login page. Second thing you are comparing username with password.

 if(un.equals(pw)){

You need to do something like this :

if(un.equals(username)&&pw.equals(password)){

Given below the login page code :

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here </title>
</head>
<body>
<form name="myform" action="login" method="post">
<p>User name: <input type="text" name="username"><br>
Password: <input name="password" type="password">
<br>
<input type="submit">
</p>

</form>
</body>
</html>









Related Pages:
http status 500 error in tomcat 6 while using eclipse helios
http status 500 error in tomcat 6 while using eclipse helios  ...=6 color=red>"+msg+"<font>"); } public void destroy... The server encountered an internal error () that prevented it from fulfilling
http status 500 error in tomcat 6 while using eclipse helios
http status 500 error in tomcat 6 while using eclipse helios  ...=6 color=red>"+msg+"<font>"); } public void destroy... The server encountered an internal error () that prevented it from fulfilling
http status 500 error in tomcat 6 while using eclipse helios
http status 500 error in tomcat 6 while using eclipse helios  ...=6 color=red>"+msg+"<font>"); } public void destroy... The server encountered an internal error () that prevented it from fulfilling
http status 500 error in tomcat 6 while using eclipse helios
http status 500 error in tomcat 6 while using eclipse helios  ...=6 color=red>"+msg+"<font>"); } public void destroy... The server encountered an internal error () that prevented it from fulfilling
http status 500 error in tomcat 6 while using eclipse helios
http status 500 error in tomcat 6 while using eclipse helios  ...=6 color=red>"+msg+"<font>"); } public void destroy... The server encountered an internal error () that prevented it from fulfilling
HTTP Status 500 -
HTTP Status 500 -   Hi, I am new to jsp... Installed Tomcat 5.5.... wrote. i can see these errors... HTTP Status 500 - type Exception report... of your tomcat. 8)Open your browser and type the following url: http://localhost
HTTP Status 500 -
HTTP Status 500 -   I've installed my Java libraries, and I am... attempt to load a JSP file from my Apache Tomcat server I get the error below. TTP Status 500 - type Exception report message description The server
error "HTTP Status 500"
error "HTTP Status 500"  How to solve this error "HTTP Status 500
error of HTTP Status 404 while running servlet on apache tomcat server
error of HTTP Status 404 while running servlet on apache tomcat server ... here, the browser responds "HTTP Status 404 - /java_mail/hello" wht could... and have set classpath properly. on typing "http://localhost:8080" i do get
Tomcat 7 in Eclipse Helios
Video Tutorial: Tomcat 7 in Eclipse Helios step by step This video tutorial shows you how you can configure Tomcat 7 in Eclipse Helios IDE. If you... for Tomcat 7. Installing Eclipse Helios and configuring the Tomcat 7
HTTP Status 404 - Struts
HTTP Status 404   Hello, i am making a program of tiles using Struts2. i face error HTTP Status 404 May 4, 2010 11:31:59 AM org.apache.catalina.core.AprLifecycleListener init INFO: The Apache Tomcat Native library which
Eclipse-Apache tomcat error
Eclipse-Apache tomcat error  Hi..I'v been trying to install apache tomcat 7 with eclipse helios to try web applications ..but unable to run webcontents .it gives the folowing msg in eclipse:Several ports (8005, 8080, 8009
HTTP Status 404 - /web/login/showLogin.action Error in Struts 2 - Struts
HTTP Status 404 - /web/login/showLogin.action Error in Struts 2  Hi Everyone I am using the following version for my project: Tomcat 6.0.16... /loginSuccess.jsp I have configured the tomcat server using eclipse
Also HTTP Status 404 - /Login/userdetail.java
Also HTTP Status 404 - /Login/userdetail.java  same can't to run.. error also please help.. index.jsp <%@page pageEncoding="UTF-8"%> <...); } } } *please help.. Thx alot  Post your error that comes while running
JSP Error 500
;     JSP Error 500 is to generate error status 500... In this section, you will learn how to generate error status 500 in jsp. You can see... response.SC_INTERNAL_SERVER_ERROR in place of status code 500.     Here
HTTP Status 404 - /Login/userdetail.java
HTTP Status 404 - /Login/userdetail.java  I using netbeans to coonect.. why always error.. help pls.. thx index.jsp <%@page contentType...;head> <meta http-equiv="Content-Type" content="text/html; charset
Tomcat
Tomcat  why we get the error like HTTP Status 500 -.what is the solution for this problem
TOMCAT
TOMCAT  why we got the error like HTTP Status 500 - type Exception report message description The server encountered an internal error... javax.servlet.ServletException: Error instantiating servlet class InsertServlet
Connection pool in Tomcat 6 - JDBC
Connection pool in Tomcat 6  Hello Everybody, I am trying to implement connection pooling in Tomcat 6 and MySQL 5.0.41 with mysql-connector... the details specified in the following URL http://tomcat.apache.org/tomcat-6.0
Web services using eclipse helios and apache tomcat-7
Web services using eclipse helios and apache tomcat-7   My name is sahas shah studying in mca. I want to use web service in project which is on tours and travels. I am using Eclipse Helios and Apache tomcat Server version 7. I
Struts 2 : Http Status Error 404 - Struts
Struts 2 : Http Status Error 404  Hi All, I'm facing the below... --------------------------------------------------------------------------- I started the tomcat server and typed http://localhost...: --------------------------------------------------------------------------HTTP Status 404
java http 404 status error - JSP-Servlet
java http 404 status error  I have tried to call a servlet from html page.. but it is showing http 404 status error.. and the description... application folder and servlet in classes folder of apache tomcat. The web
HTTP Status 404 - JSP-Servlet
HTTP Status 404  Respected Sir/madam, I am R.Ragavendran.. I am using J2EE1.4 SDK Application Server.. When I was working with it yesterday,Suddenly i found my server throwing the following Error: HTTP Status 404
HTTP Status 404 -
HTTP Status 404 -   HTTP Status 404 - type Status report message description The requested resource () is not available. Apache Tomcat/5.5.31 how to rectify the above error
Tomcat with quartz by using eclipse ide
Tomcat with quartz by using eclipse ide  Hai friends I am in a position to run a simple quartz hello job program in eclipse by using tomcat server. when i run this in tomcat server it shows 404 error that is resources
Problem while using tomcat 6.0 in eclipse with struts application
Problem while using tomcat 6.0 in eclipse with struts application  Hi please provide solution for the following problem org.apache.jasper.JasperException: java.lang.ClassCastException
Error with Maven while deploying the war file
Error with Maven while deploying the war file  Hi, I am new... any link on the index page it shows 500 error.. My pOM.xml is <project... web.xml and inside the pages folder i kept all jsp pages... After this using
Download Eclipse Helios And Add The Tomcat7 For Java EE6
are able to create your application using the Eclipse Helios IDE. To create...Download Eclipse Helios And Add The Tomcat7 For Java EE6 In this tutorial you will learn how to download the Eclipse Helios IDE and how to add the tomcat7
Tomcat Configuration For Eclipse Server
Tomcat Configuration For Eclipse Server  How to configure Eclipse Tomcat Server? I am using Tomcat 6.0v Thanks In Advance   Install tomcat on eclipse 1)First download the tomcat and install it on your hard drive. 2
Tomcat Server configuration with Eclipse at remote machine
Tomcat Server configuration with Eclipse at remote machine  "Several Ports (8081,8009), required by /Tomcat v6.0 Server at a localhost are already... process or change the port number(s)." This is the error that occurs while running
urgent-Exception in Tomcat - Java Beginners
urgent-Exception in Tomcat  I am using eclipse ee and tomcat server... raises following exception.Html pages is working . HTTP Status 500... an internal error () that prevented it from fulfilling this request. exception
Tomcat Books
will learn how to integrate Tomcat with the Apache HTTP server (and the situations..., readers will find a coverage on database connectivity using Tomcat. ... that are normally XML-formatted. Because Tomcat includes its own HTTP server
http 404 resource not found error
http 404 resource not found error   Sir, I have downloaded your RichLRApplication and deployed on tomcat 6 with oracle backend. Application started in tomcat manager. But when I try to run I am getting http 404 requested resource
Eclipse instalation error - IDE Questions
(eclipse-jee-galileo-SR2-win32.zip). while double clicking on eclipse.exe its is giving an error. I am operating this on windows xp sp3 and i'm using jre and set..., Please visit the following link: http://www.roseindia.net/IDE/Eclipse
Guide to download and install Tomcat 6
Guide to download and install Tomcat 6   ... the process to downloading and installing Tomcat 6 on your computer system... for tomcat server to proceed the HTTP requests.  The user can also change the 'port
Connection pool in Tomcat 6 - JDBC
Connection pool in Tomcat 6  Hi All, Any one please tell me how to implement connection pooling in Tomcat 6 and MySQL 5.0.1b. Thanks, Ramarao  Hi Friend, Please visit the following link: http
http status 404-servlet action is not available - Struts
http status 404-servlet action is not available  hi, i m getting "http status 404-servlet action is not available" in my tomcat5.5 and i m using struts2.0.14 what is the problem pls tell me
HTTP Status 404 - /user/AddToCart.do - Struts
HTTP Status 404 user AddToCart   Hi, I download the JSP source code to run the online shopping cart. Whenever I try to add a Item to cart, it shows me the error page with HTTP Status 404 - /user/AddToCart.do What
plugins in eclipse helios
plugins in eclipse helios  How to add the capabilities of already builtin plugins to the project in eclipse helios
Error 404 on localhost:8080 Tomcat Apache 6.0.32 with Elipse IDE and IE/Other Browsers
Error 404 on localhost:8080 Tomcat Apache 6.0.32 with Elipse IDE and IE/Other Browsers  HTTP Status 404 - type Status message description... display http://localhost:8009 - cannot display On the IDE with Eclipse I get
apache tomcat start error - Java Server Faces Questions
apache tomcat start error  Hi sir,While starting tomcat services i am getting this error so please give me solution and i am using windows 7 operating system ERROR:- Windows could not start the Apache Tomcat 6 on Local
Tomcat 6.0
Tomcat 6.0  Hi,this is harish i got an issue while running my project.I hope something wrong with my tomcat server .. ERROR:An internal error.../runtime/IPath; An internal error occurred during: "Starting Tomcat v6.0
Error with Maven while deploying the war file
Error with Maven while deploying the war file  Hi, I am new... on the index page it shows 500 error.. My pOM.xml is 4.0.0... and inside the pages folder i kept all jsp pages... After this using the command
Error 500: WSWS3142E: Error: Could not find Web services engine. - WebSevices
Error Could not find Web services engine   Hi...: faultNode: faultDetail: {}:return code: 500 Error 500: WSWS3142E: Error: Could not find Web services engine. { http://xml.apache.org/axis
HTTP 500 Internel server error in Custom tag program on Weblogic 8.1 - Java Beginners
HTTP 500 Internel server error in Custom tag program on Weblogic 8.1  Dear sir, Please attend my problem... I face the Error 500 Internel server error when I run the custom tag program on weblogic 8.1. My program Structure
HTTP Status 405 - Request method 'GET' not supported. Its urgent
HTTP Status 405 - Request method 'GET' not supported. Its urgent  When I use window.open('/admin/provisionNodeSamlPost.do?actionType=metadataview') in onclick method, following error is displaying in new window. "HTTP Status 405
problem with starting tomcat - IDE Questions
problem with starting tomcat  I'm running Eclipse 3.1with Tomcat 5.5 When I start Tomcat inside of Eclipse using the "Servers" tab, the "Console......" and eventually comes back with the error message: Timeout waiting for Tomcat
How to run a simple jsp page in tomcat???
Status 500 - type Exception report message description The server encountered...\Tomcat 6.0\lib\servlet-api.jar using this ,i am able to run all servlet programs...How to run a simple jsp page in tomcat???  i am trying to run
Error Message in Eclipse - Development process
Error Message in Eclipse  Hi Friend, My changes in servlet file is not reflected.Am using Eclipse ide and weblogic server. I think save option is not working in Eclipse. Am getting error message while saving. Now save
Eclipse helios "Build Before Launch"
Eclipse helios "Build Before Launch"  Hi The IDE Eclipse Helios present having an issue related to ?Build before Launch?. it still tries to build... look into this issue . i have tried these settings for Eclipse Helios

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.