Re: [Opensymphony-oscache] How to end NPE error on flush by group?

Andres <[email protected]> Wed, 07 Sep 2005 19:38:28 -0700
Newsgroups gmane.comp.java.open-symphony.os-cache
Message-ID <[email protected]>
This is fixed in cvs.

Joe Reger wrote:

>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
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [email protected]
>For additional commands, e-mail: [email protected]
>
>  
>