-->
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.  [ 1 post ] 
Author Message
 Post subject: NullPointerException in PersistentMap.get() in 3.6.7
PostPosted: Fri Sep 30, 2011 3:56 am 
Newbie

Joined: Thu Aug 25, 2005 10:04 am
Posts: 6
Hi,

I faced a NPE at PersistentMap.get(Object key).
Code:
Caused by: java.lang.NullPointerException: null
   at org.hibernate.collection.PersistentMap.get(PersistentMap.java:170) ~[hibernate-core-3.6.7.Final.jar:3.6.7.Final]


The line in question is
Code:
   return result==UNKNOWN ? map.get(key) : result;


The only possible NPE is (map == null), but shouldn't this be handled internally? I have debugged the problem and can confirm that map is null at this point. I don't know the internal contract of PersistentMap, so can someone guide me how to avoid this? I will not post the complete configuration yet because it is a rather big application and I need some pointers where to look.

PersistentMap state just before the exception occurs:
Code:
cachedSize -1   
directlyAccessible false   
dirty false   
initialized false   
initializing false   
key Integer  (id=334)
  value   50
map null
operationQueue null   
owner Sample  (id=580)   
role   "xxx.Sample.localizedName.localizedStrings" (id=235)   
session SessionImpl  (id=337)   
storedSnapshot null   


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

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.