This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Murach's Python Programming and have Michael Urban and Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Error JSP - Tomcat  RSS feed

 
Peter Mest
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could help please with this:


The Error

org.apache.jasper.JasperException: An exception occurred processing JSP page /index.jsp at line 65

62: int i = 1;
63: ResultSet res;
64: res = batman.querry("SELECT * from db");
65: while (res.next())
66: {
67: %>
68: <tr>

Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:505)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:416)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

root cause

java.lang.NullPointerException
org.apache.jsp.index_jsp._jspService(index_jsp.java:121)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)



The code is here: http://www.coderanch.com/t/458921/JSP/java/value-useBean-class-attribute-invalid#2047396
 
Ashutosh Gawande
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It not a good practice to write code to connect to DB from JSP but following should help to know the reason

do not supress the exception in connect class line 39
return null;
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!