JSP run problem

JSP run problem

type Exception report

message 

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

exception 

org.apache.jasper.JasperException: Exception in JSP: /bb.jsp:52

49:                 {
50:                 out.println("Failed to success");
51:                 }
52:                 pstat.close();
53:                 con.close();
54:             
55:             


Stacktrace:
    org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:451)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:373)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:803)


root cause 

java.lang.NullPointerException
    org.apache.jsp.bb_jsp._jspService(bb_jsp.java:96)
    org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:803)


note The full stack trace of the root cause is available in the Apache Tomcat/5.5.25 logs.
View Answers

March 27, 2012 at 4:39 PM

Post your code. It seems that there is a programming error. Check your code.


March 28, 2012 at 9:32 AM

OK this the code plz help me as quik as possible thnk u

blackberry.html

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
    <title>Blackberry & Datacard Asset</title>
    <head>
    <link rel="stylesheet" href="css/style.css" type="text/css" charset="utf-8" />  


    <!--[if lte IE 7]>
    <link rel="stylesheet" href="css/ie.css" type="text/css" charset="utf-8" />
    <![endif]-->
    </head>


    <body>
        <div id="header">


            <a href="index.html" id="logo"><img src="images/EATON-Logo.gif" alt="LOGO" /></a>

        <div id="navigation">   

            <ul>        
            <li class="first"><a href="index.html">Home</a></li>
            <li class="selected"><a href="Asset.html">Asset Allocation</a></li>
            <li><a href="services.html">Contact</a></li>
            <li><a href="solutions.html">About</a></li>             

            </ul>       
        </div>


        <div id="search">       

            <form action="">
            <input type="text" value="Search" class="txtfield" onblur="javascript:if(this.value==''){this.value=this.defaultValue;}"onfocus="javascript:if(this.value==this.defaultValue){this.value='';}" />

            <input type="submit" value="" class="button" />
            </form>     
        </div>  
</div> 




<!-- /#header -->   
        <div id="contents"> 
        <div class="background">
        <h3></h3>
<div id="contents"> 
<div class="background">
<h3></h3>
<p>
<a href="blackberry.html">BlackBerry & DataCards</a>. 
</p>        

<center>
<form name="form" action="bb.jsp" method="post">

<table cellpadding=12 cellspacing=6 border="1" bgcolor="#efefef" align="center">
    <th bgcolor="#efefef" colspan=8>
    <font size=5>BlackBerry & DataCards Asset</font> <br>
    <font size=2 color="red"><sup>*</sup> Required Fields</font></th>

<tr bgcolor="#efefef">
        <td valign=top>EID<b><sup>*</sup></b></td>
        <td><input type="text" name="eid" value="" size=10
            maxlength=10> <br>
        </td>
    </tr>

<tr bgcolor="#efefef">
        <td valign=top>UserName<b><sup>*</sup></b></td>
        <td><input type="text" name="usernm" value="" size=25
            maxlength=10> <br>
        </td>
    </tr>

<tr bgcolor="#efefef">
        <td valign=top>WS NUmber<b><sup>*</sup></b></td>
        <td><input type="text" name="wsno" value="" size=25
            maxlength=10> <br>
        </td>
    </tr>


<tr bgcolor="#efefef">
        <td valign=top>Device<b><sup>*</sup></b></td>
        <td><select name="device" id="course" style="width: 158px;">
            <option value="Select">---- Select ----</option>
            <option value = "Blackberry">BlackBerry</option>
            <option value = "DataCards">DataCard</option>
            </select> <br>
        </td>
    </tr>


<tr bgcolor="#efefef">
        <td valign=top>Model<b><sup>*</sup></b></td>
        <td><input type="text" name="model" value="" size=10
            maxlength=10> <br>
        </td>
    </tr>


<tr bgcolor="#efefef">
        <td valign=top>Service Provider<b><sup>*</sup></b></td>
        <td><input type="text" name="service" value="" size=20
            maxlength=10> <br>
        </td>
    </tr>

<tr bgcolor="#efefef">
        <td valign=top>IMEI Number<b><sup>*</sup></b></td>
        <td><input type="text" name="imei" value="" size=15
            maxlength=10> <br>
        </td>
    </tr>

<tr bgcolor="#efefef">
        <td valign=top>MEID Number<b><sup>*</sup></b></td>
        <td><input type="text" name="meid" value="" size=10
            maxlength=10> <br>
        </td>
    </tr>

<tr bgcolor="#efefef">
        <td valign=top><br>
        <input type="submit" name="add" value="AddNew" size=25></td>
        <td valign=top><br>
        <input type="reset" name="button" value="reset" size=25>
        <br>
        </td>
    </tr>



</table>
</form>
</center>


<h3></h3>
<p>

<a href="laptop.html">Laptop & Desktop</a> 

</p>        

<h3></h3>           
<p> <a href=""> HeadPhone</a> </p>
<p>     
<b></b>             
 <a href="">Phone</a>.<br/><br/>                 
</p>        

</div>  </div> 

</div>
</body>
</html>

bb.jsp


<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
    <%@ page import="java.sql.*" %>
    <%@ page import="java.io.*" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>
<%
    String eid = request.getParameter("eid");
    String usernm = request.getParameter("usernm");
    String wsno = request.getParameter("wsno");
    String device = request.getParameter("device");
    String model = request.getParameter("model");
    String service = request.getParameter("service");
    String imei = request.getParameter("imei");
    String meid = request.getParameter("meid");



    Connection con = null;
    PreparedStatement pstat = null;

    int updateQuery = 0;



            try
            {
            Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");  
            con = DriverManager.getConnection("jdbc:odbc:asset");
            String Qry = "INSERT INTO blackberry&datacards(User_id,User_name,WS_no,Device,Model,Service_Provider,IMEI,MEID) values('"+eid+"','"+usernm+"','"+wsno+"','"+device+"','"+model+"','"+service+"','"+imei+"','"+meid+"')";
            pstat = con.prepareStatement(Qry);



            updateQuery = pstat.executeUpdate();

                    if(updateQuery != 0)
                        {%>
                        <br>
                   <TABLE style="background-color: #E3E4FA;" 
                   WIDTH="30%" border="1">
                      <tr><th>Data is inserted successfully in database.</th></tr>
                   </table>
                    <%  
                    }
            }
            catch(Exception e)
                {
                out.println("Failed to success");
                }
                pstat.close();
                con.close();





%>


</html>









Related Tutorials/Questions & Answers:
JSP run problem
JSP run problem  type Exception report message description... this request. exception org.apache.jasper.JasperException: Exception in JSP...) root cause java.lang.NullPointerException org.apache.jsp.bb_jsp
How to compile and run the JSP
How to compile and run the JSP  Hi Kindly tell me how to run and compile JSP small Program using Tomcat as webserver. I created small program HELLO JSP in HTML and compile the program but it is saying Class o r interface
Advertisements
Run time problem
Run time problem  when i run a project,it shows an exception like "unable to create MIDlet".It also shows "running with locale:English_united States.1252 running in the identified third party security domain" "please help
Problem in jsp.
Problem in jsp.  hello friends, I have a problem in jsp.I want to insert data, which is given by user through a html page into a table.And the table..." action="http://localhost:8080/examples/jsp/insertdata.jsp"> <table> <
Problem in jsp.
Problem in jsp.  hello friends, I have a problem in jsp.I want to insert data, which is given by user through a html page into a table.And the table..." action="http://localhost:8080/examples/jsp/insertdata.jsp"> <table> <
Problem in jsp.
Problem in jsp.  hello friends, I have a problem in jsp.I want to insert data, which is given by user through a html page into a table.And the table..." action="http://localhost:8080/examples/jsp/insertdata.jsp"> <table> <
Jsp problem
Jsp problem  Hello friends.I want to share my jsp problem.I want to show all of my database(mysql) tables except two(user,manufacturer) in a jsp page.plssss help me
jsp problem
jsp problem  problem:::::::: On JSP form ,when i insert data in text field........at that time action is perform and data is retriev from data base and get assign to other field on that form........ when data is assign to other
jsp problem
jsp problem  Hello Friends, I want to show one page for 5 seconds and after that i want to redirect the page to another URL
jsp problem
jsp problem  Hi every one plz give me answer for below question ASAP I created one JSP(used pre defined javascript in jsp to get rtf format in browser) which creats RTF Format in browser to enter data. MY question is after i
JSP Problem - JSP-Servlet
JSP Problem  Hi, I have problem,this is my senario I have one jsp,this jsp having the 3 fields.let me take 3fields userName,emailAddress... for more information, http://www.roseindia.net/jsp Thanks
jsp problem - JSP-Servlet
jsp problem  here is a code for Retrieving image from mysql database through jsp. but i cann't set size of image when it was display so what should... working but my problem is size of image. so can u just help?? code
jsp problem - JSP-Servlet
jsp problem  here is a code for Retrieving image from mysql database through jsp. but i cann't set size of image when it was display so what should... working but my problem is size of image. so can u just help?? code
run jsp file
run jsp file  how to run the jsp file in varies web servers  ... the class path also. The jsp file is to be saved into the web application folder.Let...:8080/examples/abc.jspADS_TO_REPLACE_2 For more information on JSP visit to : JSP
jsp problem - JSP-Servlet
jsp problem  hi, i am working on a project of developing a shopping cart for online book store.can it be done using jsp?if yes, can u please help me doing so?  Hi Friend, Please visit the following link: http
problem in jsp programming - JSP-Servlet
problem in jsp programming  Write a JSP program which displays a webpage containing arrival of new items within a particular month in the different... in solving the problem : Connection with mysql database
problem in programming - JSP-Servlet
problem in programming  Hi! I am new with jsp. I am facing a problem in programming to calculate the time interval between login time and logout time of user
jsp usebean problem - Struts
popupwindow jsp below code run.. ...here iam getting the problem..in the below...jsp usebean problem   --Select... jsp
jsp code problem - JSP-Servlet
jsp code problem  Hi, I have employee details form in jsp. After... have a problem with open the next form. plz, help me. thanks,  Hi.... http://www.roseindia.net/jsp/ Thanks
Session Problem in JSP - JSP-Servlet
Session Problem in JSP  I have developed a online feedback form in JSP platform. I have created normal session in JSP page. It is running in my... normally from Remote machine by only writing JSP code.  Hi friend
How to run JSP program inEclipse?
How to run JSP program inEclipse?  Hi, I am learning JSP. I want to run JSP in Eclipse. How to run JSP program inEclipse? Thanks   Hi, Its easy to run JSP from the Eclipse. You have to make a dynamic web application
jsp reload current page problem
jsp reload current page problem  Hi, i am facing problem while reloading the JSP page
jsp reload current page problem
jsp reload current page problem  Hi, i am facing problem while reloading the JSP page
how to run a vlc player in jsp
how to run a vlc player in jsp  how to run a vlc player in jsp
how to run a .exe file in jsp
how to run a .exe file in jsp  i want code for to run a .exe file in jsp
Java Problem - JSP-Servlet
Java Problem  How to run a Simple JSP program ? what steps... the webapps folder of apache tomcat. 5)Create a jsp file 'hello.jsp'.You can put your jsp file either inside the web application folder along with WEB-INF or you
logout problem?? - JSP-Servlet
logout problem??  sir, the logout code which u have send is not the proper solution coz,by using this code the browser get closed which shuold.../Logout.shtml http://www.roseindia.net/jsp/loginstatus.shtml Thanks
jsp image problem - JSP-Servlet
jsp image problem  hi everyone, How to display multiple images from mysql database to jsp page. please help me
JSP handle run-time exceptions
JSP handle run-time exceptions  How does JSP handle run-time... to have uncaught run-time exceptions automatically forwarded to an error processing... the browser to the JSP page error.jsp if an uncaught exception is encountered during
logout problem.. - JSP-Servlet
logout problem..  hi... first of all thanks for ur... but their is some problem with the the logout,i m not able to logout when... done in the code i have used session object in project's servlet and jsp
jsp code problem - JSP-Servlet
jsp code problem  hi, I am going to execute the following code which has been given your jsp tutorial. retrive_image.jsp: but while I... server. plz help me to run this code........ HTTP Status 500 - type Exception
how to deploy and run jsp - JSP-Servlet
how to deploy and run jsp  hi anybody plz tell how to deploy and run jsp. and where jsp and html files save in web-inf or any where?  Hi...- WEB-INF-classes | | root web.xml You save the jsp or html
coding problem - JSP-Servlet
coding problem  dear sir i m very new to JSP sir i m getting problem in dynamically changing the option of combobox from database(ms acess) .and after that option being selected for that the record from the databse should
JSP code problem - JSP-Servlet
JSP code problem  Hi friends, I used the following code...: <% //to get the content type information from JSP... of: Please can somebody rectify this problem........  
how to run jdbc in jsp program - JSP-Servlet
how to run jdbc in jsp program  i want to use sql server 2005 in jsp program to store data.i know how to run simple program but this program i tried... visit the following links: http://www.roseindia.net/jsp/submit-comments
how to run jsp appication in eclipse
how to run jsp appication in eclipse  after setting the tomcat in eclipse, i m trying to run jsp page, but the pop up has come that "selection did not contain any resources that can run on server". plase tell me i m new to handle
Jsp Code Problem - JSP-Servlet
Jsp Code Problem  I use DocType in my Jsp Page. The Links are not functioned after Applying the DocType. Could you tell me any way to activate the link. Thank You.   Hi Friend, Please send your code. Thanks
JSP code problem - JSP-Servlet
JSP code problem  HI.. I have a DB2 stored procedure wich return a result set. I have made a report basing on this procedure using Crystal Reports. How to pass parameters to this procedure with java code in a JSP page
jsp code problem - JSP-Servlet
jsp code problem  i want to make the bill from the barcode. how do i convert a barcode into a decimal number
Applet run with appletviewer but not in browser, any code problem.
Applet run with appletviewer but not in browser, any code problem.  Hi,My problem is when I am running my applet in appletviewer index.html, Its work fine but not run from the browser as http://localhost:8080/ProgressoApplication
Jsp ,Servlet Problem - JSP-Servlet
Jsp ,Servlet Problem  hi, m new to jsp n Servlet. i really find ur tricks very effective.Last time u had helped me to connect my java program with oracle. it worked wonders. now i m starting jsp n servlet learning.. pls
Jsp error when i run this a jsp file
Jsp error when i run this a jsp file  hi I got this error when i run the jsp file in IDE and outside also please help me java.lang.NullPointerException org.apache.jsp.insertjsp.jspInit(insert_jsp.java:22
Statistical charts in JSP - problem
Statistical charts in JSP - problem  hey! i get this error when i run... to compile class for JSP: An error occurred at line: 9 in the generated.... org.jfree.data.jdbc.JDBCCategoryDataset resolves to a package An error occurred at line: 11 in the jsp
Unable to run jsp files on internet explorer - JSP-Servlet
Unable to run jsp files on internet explorer  Hi, I am Akhilesh Shrivastav. I am new to jsp and a new member of this site. My problem is i wrote a small jsp program stored in the Web-Apps folder of Apache Tomcat. But i
Radio Button Problem in jsp.
Radio Button Problem in jsp.  I have a small doubt in my application, my requirement is to get a "single selectible row", I generated a radio button... radio button values from jsp to action using javascript
tomcat problem - JSP-Servlet
perfectly. Kindly let me know what is the problem at an earliest. Thanking... found your problem.. http://www.roseindia.net/web-application-server/tomcat
coding problem - JSP-Servlet
coding problem  dear sir will u plz tell me how can we delete a record from the database(MSaccess) when option in the combobox is selected(jsp)  If u want to delete the record from database, by seleting
Jsp include page problem
Jsp include page problem  I have included footer.jsp in all my pages. It is working in all pages except search.jsp. In search.jsp (Old footer.jsp content is displayed ) How can I rectify this?   Hi, You have to delete
resultset problem - JSP-Servlet
resultset problem  hi I have one problem with resultset? ResultSet rs=st.execute("select subjname,staffname from staffdetails"); while(rs.next()) { st.executeUpdate("update CSEFIRSTYEARTIMETABLE set p2
coding problem - JSP-Servlet
coding problem  Dear sir i m very new to JSP .I am using two conbobox .if any option is selected in first combobox then only its data from the database should be displayed in other combobox, means how can we refresh

Ads