sim51/logisima-play-neo4j — Issue #11: Binding longs in base model class causes verify error
Author: jph303
Created: 2012-01-26 23:33:13+00:00
State: open

Add long members to model classes causes verify error.

The following code causes creationDate to be loaded correctly but modifiedDate(the long) to throw verification error.

public class BaseModel extends Neo4jModel{

public String creationDate;
public long modifiedDate;
public String status;

public BaseModel(){
super();
}

@Override
public T save() throws Neo4jException {
ModelManager modelManager = (ModelManager) Spring.getBean("modelManager");

if(this.node == null)
{
this.creationDate = String.valueOf(modelManager.getCurrentTimeStamp());
this.status = TandemConstants.VALUE_STATUS_ACTIVE;
}
this.modifiedDate = modelManager.getCurrentTimeStamp();
return super.save();
}
}
changing modifiedDate to a string will fix the issue. The exception is as follows:

Execution exception (In /app/jobs/Bootstrap.java around line 14)
RuntimeException occured : Cannot load fixture data.yml: (class: models/BaseModel, method: getModifiedDate signature: ()J) Expecting to find integer on stack

play.exceptions.JavaExecutionException: Cannot load fixture data.yml: (class: models/BaseModel, method: getModifiedDate signature: ()J) Expecting to find integer on stack
at play.jobs.Job.call(Job.java:155)
at Invocation.Job(Play!)
Caused by: java.lang.RuntimeException: Cannot load fixture data.yml: (class: models/BaseModel, method: getModifiedDate signature: ()J) Expecting to find integer on stack
at play.modules.neo4j.util.Fixtures.loadYml(Fixtures.java:166)
at jobs.Bootstrap.doJob(Bootstrap.java:14)
at play.jobs.Job.doJobWithResult(Job.java:50)
at play.jobs.Job.call(Job.java:146)
... 1 more
Caused by: java.lang.VerifyError: (class: models/BaseModel, method: getModifiedDate signature: ()J) Expecting to find integer on stack
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
at java.lang.Class.privateGetPublicMethods(Unknown Source)
at java.lang.Class.getMethods(Unknown Source)
at play.modules.neo4j.util.Binder.(Binder.java:67)
at play.modules.neo4j.util.Fixtures.bind(Fixtures.java:263)
at play.modules.neo4j.util.Fixtures.loadYml(Fixtures.java:153)
... 4 more