Here is my Document model:
@Entity
@Table(name = "documents")
public class Document extends Model {
@Id
public Long id;
@Constraints.Required
@Formats.NonEmpty
@Column(nullable=false)
public String document;
public static Model.Finder<Long,Document> find = new Model.Finder(Long.class, Document.class);
public String getUrl() {
return controllers.routes.Documents.display(document.toLowerCase()).absoluteURL(Http.Context.current().request());
}
}
The problem is that it throws a VerifyError exception at compile time, and the only thing I found to avoid this was to comment out the line and replace it with return null; => Not very effective: /
Here's the stack trace for this exception:
Caused by: java.lang.VerifyError: Bad type on operand stack in method models.Document.getUrl()Ljava/lang/String; at offset 13
at java.lang.Class.forName0(Native Method) ~[na:1.7.0_05]
at java.lang.Class.forName(Class.java:264) ~[na:1.7.0_05]
at play.db.ebean.EbeanPlugin.onStart(EbeanPlugin.java:69) ~[play_2.9.1.jar:2.0.2]
What is this error and how to avoid it without losing the getUrl method?
Thank you for your help!
source
share