• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

Connection to the database Failure

 
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 67750
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Barry's not gonna like this. Barry's not gonna like this one bit. What is Barry's deal with tiny ads?
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic