JSP run problem

Ads
 

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>

Ads









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
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
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
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
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 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
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
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
Statistical charts in JSP - problem
Statistical charts in JSP - problem  hey! i get this error when i run... org.apache.jasper.JasperException: Unable to compile class for JSP: An error occurred... An error occurred at line: 11 in the jsp file: /BarChart.jsp
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
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
platform(s/w requirements) for run jsp programs?
platform(s/w requirements) for run jsp programs?  in which platform jsp programms are run
jsp and bean problem
jsp and bean problem  Hi i have the following jsp code... Can you plz help me in separating the code to bean? I'm new to bean and need it for my project...Plz help...Its quite urgent... Regards Priya <%@ page import
problem in jsp using ms-access
problem in jsp using ms-access  after starting server(tomcat) wen v...)Your DSN will get created. 6) Restart your server and run your jsp code. Here... will get created. 6) Restart your server and run your jsp code. Here is your
Problem in record viewing in jsp - JSP-Servlet
Problem in record viewing in jsp  hai i have developed the application using jsp,servlets in eclipse ide i have to insert,delete,update and view . no problem all are working but in view part alone some problem i dont know what
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
run command prompt from jsp program
run command prompt from jsp program  Hi.... Is it possible to run a command prompt from jsp? If possible please help me with some code... Thanks & Regards vanchinathan.R
problem in record viewing in jsp - JSP-Servlet
problem in record viewing in jsp  hai i send the code can you please find where is the problem it is not showing any error but i cannot able to view the record after eclipse ide is closed and reopen it i have used the jsp
JSP - Problem of displaying result at webpage
JSP - Problem of displaying result at webpage  Can anyone please help to solve my problem below. My webpage has problem in displaying result position. The result should be display below my title. How do i solve it? Thank you so
Java Servlet Problem - JSP-Servlet
method. Please help!!  Hi friend, Please explain problem in details for complete solution and send code the where are you problem. Thanks
problem at the time of execution - JSP-Servlet
problem at the time of execution  when i was running web applications the exception i.e 404 resource is not available what it means and where it occures what is the solution   Hi Friend, This error occurs when
apache tomcat problem - JSP-Servlet
apache tomcat problem  hi, i am trying to run apache tomcat. but it is showing "The CATALINA_HOME environment variable is not defined correctly This environment variable is needed to run this program" error. CATALINA_HOME

Ads