I am getting the following error when running my Play Framework 2.2.x (Java) project:
Configuration error
Cannot register class [models.SomeClass] in Ebean server
The error messages displayed in the browser points me to the line ebean.default="models.*"
in my application.conf
, and the console tells me that I have a java.lang.VerifyError: Bad type on operand stack
in one of my methods. There is nothing special about the methods for which this happens, and it has happened for a handfull of methods now.
I have found out that the error can be avoided by using a static method instead: that is by replacing someObject.doJob()
by SomeClass.doJob(someObject)
. I have used this hack, and it works, but I am not very happy about making all my methods static when they should not be.
Has anyone encountered the same problem and found a way to fix it (without making the methods static)?
SOLVED: It turned out that the methods with problems all referenced fields that were marked as final. Apparently, Play Framework / Ebean does not like final fields in Entity classes. After removing the final
keyword from these field, the problem went away.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With