-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Hibernate no longer working after DB2 reinstall.
PostPosted: Wed Sep 22, 2010 12:04 pm 
Newbie

Joined: Wed Sep 22, 2010 11:09 am
Posts: 1
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.


Top
 Profile  
 
 Post subject: Re: Hibernate no longer working after DB2 reinstall.
PostPosted: Mon Mar 21, 2011 3:55 pm 
Newbie

Joined: Mon Mar 21, 2011 1:47 pm
Posts: 1
There's a good chance that this is due to a different db2jcc.jar version. I had a similar error with DB2, though not using Hibernate. I searched my hard drive for db2jcc.jar. The one in my Tomcat was 1164 KB, and I replaced it with one that was 1928 KB. Problem solved.

Perhaps when you reinstalled the database, it wants (or is using) a different db2jcc.jar version. Unfortunately, I don't know of any way to tell what version the working jar is, or where I got it; all I can see is that it is a different file size. Perhaps they fixed this NPE or increased logging in a later version. This was one pain in the rear issue to track down.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.