Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Connection to the database Failure

 
Menen Zwerky
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello When I click on a link of may web app a see the following exception:


exception

org.apache.jasper.JasperException: An exception occurred processing JSP page /applications/Configuration/services/officelist.jsp at line 109

106:
107: // Open Connection to the database
108: try{
109: OracleStatement stmt = (OracleStatement) conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE);
110: OracleResultSet rs = null;
111:
112: // Build SQL


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)
org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(InternalResourceView.java:91)
org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:242)
org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:712)
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:572)
org.springframework.web.servlet.FrameworkServlet.serviceWrapper(FrameworkServlet.java:366)
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:317)
javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)


root cause

java.lang.NullPointerException
org.apache.jsp.applications.Configuration.services.officelist_jsp._jspService(officelist_jsp.java:484)
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)
org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(InternalResourceView.java:91)
org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:242)
org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:712)
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:572)
org.springframework.web.servlet.FrameworkServlet.serviceWrapper(FrameworkServlet.java:366)
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:317)
javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)



It sounds like a problem about db connection
Any suggestions?
Thanks Menen
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65115
89
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You've got a null pointer execption in your JSP. I assume that means you've put Java code in your JSP?

First step I'd take is to conform to modern standards and factor all code out of the JSP and into a servlet controller where it will be easier to debug.
 
Menen Zwerky
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the advice! Unfortunately I have to reuse this old structured code i'm not allowed to change a lot. I installed the same web application in a different site node,
so that I bumped in the exception we talked above. In the other site instead it worked fine. The only setting i did where about configuration files, not src files.
Thanks Menen
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic