tags:

views:

21

answers:

1

When I run an application that uses db40 I get the following error:

Any ideas? Everything looks fine and "Hashtable l = db4o.db.getTheDatabase().getPlants();" shows OK in netbeans (all the methods were correctly written).

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request. exception

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

34: 
35: 
36: <%
37: Hashtable <String, db4o.Plant> l = db4o.db.getTheDatabase().getPlants();
38: int i = 0;
39: 
40: Iterator<String> iterator = l.keySet().iterator();


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.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)

root cause

java.lang.NullPointerException org.apache.jsp.plante_jsp._jspService(plante_jsp.java:89) 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.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)

note The full stack trace of the root cause is available in the Apache Tomcat/6.0.18 logs.

+1  A: 

My first guess would be that db4o.db.getTheDatabase() returns null.

ammoQ
Was going to say the same, but you beat me to it.
jwoolard
I deleted db4o.dbo and restarted netbeans. It works now although the database is empty. The JSP loads. Thanks for the replies.
Gabriel