@Cached not working in Play Framework

110 views
Skip to first unread message

Thomas Wiradikusuma

unread,
May 1, 2011, 3:39:55 PM5/1/11
to objectify-appengine
Hi guys,

I think I found a bug in Objectify's @Cached with Play Framework. If I
have this class:

@Entity
@Unindexed
public class Test implements Serializable {
private static final long serialVersionUID = 1L;
// ... usual code
}

It's working OK. But when I add @Cached:

@Entity
@Unindexed
@Cached(expirationSeconds = 86400)
public class Test implements Serializable {
private static final long serialVersionUID = 1L;
// ... usual code
}

It will cause this exception:

Internal Server Error (500) for request GET /

Execution exception (In /app/controllers/Application.java around line
16)
ExceptionInInitializerError occured : null

play.exceptions.JavaExecutionException
at play.mvc.ActionInvoker.invoke(ActionInvoker.java:228)
at Invocation.HTTP Request(Play!)
Caused by: java.lang.ExceptionInInitializerError
at
com.googlecode.objectify.cache.ListenableFuture.addCallback(ListenableFuture.java:
126)
at
com.googlecode.objectify.cache.CachingAsyncDatastoreService.put(CachingAsyncDatastoreService.java:
518)
at
com.googlecode.objectify.impl.AsyncObjectifyImpl.put(AsyncObjectifyImpl.java:
255)
at
com.googlecode.objectify.impl.AsyncObjectifyImpl.put(AsyncObjectifyImpl.java:
229)
at com.googlecode.objectify.impl.ObjectifyImpl.put(ObjectifyImpl.java:
126)
at controllers.Application.index(Application.java:16)
at play.mvc.ActionInvoker.invokeWithContinuation(ActionInvoker.java:
541)
at play.mvc.ActionInvoker.invoke(ActionInvoker.java:499)
at play.mvc.ActionInvoker.invokeControllerMethod(ActionInvoker.java:
475)
at play.mvc.ActionInvoker.invokeControllerMethod(ActionInvoker.java:
470)
at play.mvc.ActionInvoker.invoke(ActionInvoker.java:158)
... 1 more
Caused by: java.lang.NullPointerException: Name is null
at java.lang.Enum.valueOf(Enum.java:236)
at com.google.appengine.api.utils.SystemProperty$Environment
$Value.valueOf(SystemProperty.java:70)
at com.google.appengine.api.utils.SystemProperty
$Environment.value(SystemProperty.java:91)
at
com.googlecode.objectify.cache.ListenableHook.<clinit>(ListenableHook.java:
40)
... 12 more
03:35:00,467 INFO ~ Time to persist datastore: 25 ms

Is this really a bug? Should I submit a bug in Objectify or is this
Play Framework's issue?

Jon Stevens

unread,
May 1, 2011, 4:48:00 PM5/1/11
to objectify...@googlegroups.com
NPe on a system property check?

Missplet on my ipone

Jeff Schnitzer

unread,
May 1, 2011, 10:27:10 PM5/1/11
to objectify...@googlegroups.com
This is some very strange conflict between the appengine and play. I
can't even begin to imagine the cause. You should be able to isolate
a test case with some code that just makes this call:

SystemProperty.environment.value()

BTW I am out traveling (in Mérida at the moment) so I will not be
online much until next week.

Jeff

Reply all
Reply to author
Forward
0 new messages