javagoogle-app-engineplayframeworksiena

java.lang.AbstractMethodError when trying to use Siena with the Play Framework


Okay, so I've been banging my head against this problem for a couple of days now, and I just don't know what I'm missing to get it to work. I've also tried numerous searches here and on Google, but turned up nothing that has gotten me any visibly closer to a solution.

When trying to save my first record using the crudsiena module, I get an "Execution exception" screen, with the message:

AbstractMethodError occured: play.modules.gae.PlayDevEnvironment.enforceApiDeadlines()Z

It says it happens, In {module:crudsiena-2.0.2}/app/controllers/CRUD.java (around line 259)

That line is: SienaPlugin.pm().save(object);

The same error happens when I create a new object of my data model and try to save() it in a JUnit test.

I originally started out with implementation = siena.gae.GaePersistenceManager in siena.properties in the same folder as my model class, but also tried implementation = siena.jdbc.H2PersistanceManager to try the in-memory H2 DB, but it still gives the same error.

play modules reports the following modules:

From some debug logging output I inserted into the unit test, it seems even with implementation = siena.jdbc.H2PersistanceManager, getPersistanceManager() on the instantiation of my model returns a siena.gae.GaePersistenceManager object.

My data model class is as follows (note, variable and column names have been obfuscated here):

@Table("my_model")
public class MyModel extends Model {

    @Id(Generator.AUTO_INCREMENT)
    public Long id;

    @Column("index_alpha_numeric")
    @NotNull
    public String indexAlphaNumeric;

    @Column("extra_index_numbers")
    @Embedded
    public List<String> extraNumbers;

    @Column("string_value")
    @NotNull
    public String stringValue;

    @Column("another_string")
    @NotNull
    public String anotherString;

    @Column("another_index")
    @NotNull
    public Integer another_index;

    //empty no-param constructor, required if explicit constructor with parameters specified
    public MyModel() { }

    public MyModel(String aNum, String stringVal, String string2, Integer intIndex) {
        indexAlphaNumeric = aNum;
        stringValue = stringVal;
        anotherString = string2;
        anotherIndex = intIndex;
    }


    public static Query<MyModel> all() {
        return Model.all(MyModel.class);
    }

}

I've also tried removing the embedded list, just to see if I was misunderstanding how that worked, but again, there was no difference.

I can't think of anything else I may need to include in this question right now, but if you need additional information that I haven't thought of, I'll of course be happy to oblige.

Edit: I was asked for a stack trace, so here it is. This stack trace is from the JUnit test. The issue appears to be in the GAE classes, so I'm going to poke around with that for a bit.

java.lang.AbstractMethodError: play.modules.gae.PlayDevEnvironment.enforceApiDeadlines()Z
    at com.google.appengine.tools.development.ApiProxyLocalImpl.doAsyncCall(ApiProxyLocalImpl.java:190)
    at com.google.appengine.tools.development.ApiProxyLocalImpl.makeAsyncCall(ApiProxyLocalImpl.java:151)
    at com.google.apphosting.api.ApiProxy.makeAsyncCall(ApiProxy.java:182)
    at com.google.appengine.api.datastore.DatastoreApiHelper.makeAsyncCall(DatastoreApiHelper.java:81)
    at com.google.appengine.api.datastore.AsyncDatastoreServiceImpl.put(AsyncDatastoreServiceImpl.java:266)
    at com.google.appengine.api.datastore.DatastoreServiceImpl$2.runInternal(DatastoreServiceImpl.java:113)
    at com.google.appengine.api.datastore.DatastoreServiceImpl$2.runInternal(DatastoreServiceImpl.java:110)
    at com.google.appengine.api.datastore.TransactionRunner.runInTransaction(TransactionRunner.java:31)
    at com.google.appengine.api.datastore.DatastoreServiceImpl.put(DatastoreServiceImpl.java:110)
    at com.google.appengine.api.datastore.DatastoreServiceImpl.put(DatastoreServiceImpl.java:94)
    at siena.gae.GaePersistenceManager._insertSingle(GaePersistenceManager.java:285)
    at siena.gae.GaePersistenceManager._insertSingle(GaePersistenceManager.java:267)
    at siena.gae.GaePersistenceManager.insert(GaePersistenceManager.java:253)
    at siena.gae.GaePersistenceManager.save(GaePersistenceManager.java:894)
    at siena.Model.save(Model.java:87)
    at MyModelTest.addItem(MyModelTest.java:14)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
    at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
    at play.test.PlayJUnitRunner$StartPlay$2$1.evaluate(PlayJUnitRunner.java:98)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
    at play.test.PlayJUnitRunner.run(PlayJUnitRunner.java:48)
    at org.junit.runners.Suite.runChild(Suite.java:128)
    at org.junit.runners.Suite.runChild(Suite.java:24)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
    at org.junit.runner.JUnitCore.run(JUnitCore.java:157)
    at org.junit.runner.JUnitCore.run(JUnitCore.java:136)
    at org.junit.runner.JUnitCore.run(JUnitCore.java:117)
    at play.test.TestEngine.run(TestEngine.java:101)
    at controllers.TestRunner.run(TestRunner.java:67)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at play.mvc.ActionInvoker.invokeWithContinuation(ActionInvoker.java:546)
    at play.mvc.ActionInvoker.invoke(ActionInvoker.java:500)
    at play.mvc.ActionInvoker.invokeControllerMethod(ActionInvoker.java:476)
    at play.mvc.ActionInvoker.invokeControllerMethod(ActionInvoker.java:471)
    at play.mvc.ActionInvoker.invoke(ActionInvoker.java:159)
    at play.server.PlayHandler$NettyInvocation.execute(PlayHandler.java:220)
    at play.Invoker$Invocation.run(Invoker.java:265)
    at play.server.PlayHandler$NettyInvocation.run(PlayHandler.java:200)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:98)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:206)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:662)

Solution

  • Your problem is not in the model apparently! It's in the configuration of Play+Siena IMO. Don't you have the full stacktrace?

    When you tell you use "implementation = siena.gae.GaePersistenceManager", it means in a siena.properties file? If yes, remove this file, you don't need any siena.properties file when using Play as Siena is wired to Play application.conf file.

    Can you show your dependencies.yml and you conf plz?