This week's book giveaway is in the Artificial Intelligence and Machine Learning forum.
We're giving away four copies of Succeeding with AI and have Veljko Krunic on-line!
See this thread for details.
Win a copy of Succeeding with AI this week in the Artificial Intelligence and Machine Learning forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
  • Junilu Lacar
Sheriffs:
  • Tim Cooke
  • Jeanne Boyarsky
  • Knute Snortum
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:
  • salvin francis
  • fred rosenberger
  • Frits Walraven

Connection to the database Failure

 
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
 
Sheriff
Posts: 67389
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • 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
 
I have gone to look for myself. If I should return before I get back, keep me here with this tiny ad:
Two software engineers solve most of the world's problems in one K&R sized book
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic