Hi,
I've got a project that uses a hibernate based webapp running on at tomcat server to access a db2 database. Everything worked fine until I had to reinstall the database and now hibernate doesn't seem to be working anymore.
I've checked the connection settings, and everything seems to be in order, and Hibernate does seem to be able to make a connection to the database (at least it's stopped giving me errors saying that it can't connect). However, every time I try to select or insert anything I get the following exception:
Code:
java.lang.NullPointerException
at com.ibm.db2.jcc.a.rf.a(rf.java:1267)
at com.ibm.db2.jcc.b.jb.n(jb.java:581)
at com.ibm.db2.jcc.b.jb.j(jb.java:247)
at com.ibm.db2.jcc.b.jb.c(jb.java:57)
at com.ibm.db2.jcc.b.w.c(w.java:42)
at com.ibm.db2.jcc.b.cc.h(cc.java:177)
at com.ibm.db2.jcc.a.rf.p(rf.java:1256)
at com.ibm.db2.jcc.a.sf.d(sf.java:2312)
at com.ibm.db2.jcc.a.sf.X(sf.java:508)
at com.ibm.db2.jcc.a.sf.executeQuery(sf.java:491)
at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeQuery(NewPr
oxyPreparedStatement.java:76)
at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:
139)
at org.hibernate.loader.Loader.getResultSet(Loader.java:1669)
at org.hibernate.loader.Loader.doQuery(Loader.java:662)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Lo
ader.java:224)
at org.hibernate.loader.Loader.doList(Loader.java:2145)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2029)
at org.hibernate.loader.Loader.list(Loader.java:2024)
at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:375)
at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.ja
va:308)
at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java
:153)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1106)
at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
at edu.acadia.webcensus.server.data.QuadratDAO.getQuadratByIp(QuadratDAO
.java:69)
The line where the error occurs is:
Code:
List list = q.list();
and I've checked to make sure that q isn't null right before the line is executed.
I'm pretty much totally stumped, so any help solving or diagnosing the problem would be greatly appreciated.