[Opensymphony-oscache] How to end NPE error on flush by group?
Joe Reger <[email protected]> Wed, 07 Sep 2005 13:37:00 CDT
| Newsgroups | gmane.comp.java.open-symphony.os-cache |
|---|---|
| Message-ID | <26897352.1126118257488.JavaMail.os-j2ee@opensymphony01.contegix.com> |
Hi! I'm getting an NPE error when attempting to flush by group:
throwable class name: java.lang.NullPointerException
java.util.HashSet.(HashSet.java:97)
com.opensymphony.oscache.base.algorithm.AbstractConcurrentReadCache.getGroupForReading(AbstractConcurrentReadCache.java:954)
com.opensymphony.oscache.base.algorithm.AbstractConcurrentReadCache.getGroup(AbstractConcurrentReadCache.java:372)
com.opensymphony.oscache.base.Cache.flushGroup(Cache.java:447)
com.opensymphony.oscache.base.Cache.flushGroup(Cache.java:434)
com.opensymphony.oscache.general.GeneralCacheAdministrator.flushGroup(GeneralCacheAdministrator.java:217)
Here's the calling code (admin is a GeneralCacheAdministrator and Debug is an internal debug saving routine):
public static void flushByMegafieldid(int megafieldid){
if (admin!=null){
try{
admin.flushGroup("megafieldid"+megafieldid);
} catch (Exception e){
Debug.errorsave(e, "");
}
}
}
Any ideas?
It doesn't happen every time... or even all that often. This makes me think it happens when there is nothing in the cache and the flush by group method is called. It gets to a HashSet internal to OSCache and finds it null.
Thanks,
Joe
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.opensymphony.com/thread.jspa?threadID=6541&messageID=14640#14640