What is the NullPointerException that you are getting? You shouldn't need to change your GCacheFactory. Nothing changed with that in 1.5.0, and the new package you are using is not correct. com.google.appengine.api.memcache.jsr107cache.GCacheFactory is the one you want. It is in appengine-jsr107cache-1.5.0.jar.
On Wed, May 11, 2011 at 5:00 PM, luka <[email protected]> wrote: > I have recently upgraded from GAE 1.4.3 to 1.5.0 and the MemCache service I > work with stop working. > When I try to reach it, I get NullPointerException > > I saw that the package of "GCacheFactory" was changed > to "com.google.appengine.api.memcache.stdimpl" although besides of that I am > not sure what is wrong. > > I have a simple cache implementation using Spring beans which worked well > during the last year: > > (Please help, my service has customers waiting for solution) > > > import java.util.HashMap; > import java.util.Map; > import java.util.logging.Level; > import java.util.logging.Logger; > > import com.google.appengine.api.memcache.stdimpl.GCacheFactory; > > import net.sf.jsr107cache.Cache; > import net.sf.jsr107cache.CacheException; > import net.sf.jsr107cache.CacheManager; > > public class OnLoad { > private static Logger logger = > Logger.getLogger("com.lugo.server.utils.OnLoad"); > > Cache cache; > /** > * Create Cache ( MemCache ) > */ > public void onStartup(){ > try { > Map props = new HashMap(); > int expire = 3600 * 192 ; // 8 Days > props.put(GCacheFactory.EXPIRATION_DELTA, expire); > cache = CacheManager.getInstance().getCacheFactory().createCache(props); > } catch (CacheException e) { > logger.log(Level.WARNING,"onStartup()", e); > } > } > public Cache getCache(){ > return cache; > } > > > } > > -- > You received this message because you are subscribed to the Google Groups > "Google App Engine for Java" group. > To post to this group, send email to > [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/google-appengine-java?hl=en. > -- You received this message because you are subscribed to the Google Groups "Google App Engine for Java" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
