Persistence Error: could not get a field value by reflection getter of

Hi,

I’m instantiating a new database through a UI page and when trying to submit the process I get the following error:

Submit error: { “exception”: “class org.bonitasoft.engine.exception.BonitaRuntimeException”, “message”: “USERNAME=lefloresg | javax.persistence.PersistenceException: org.hibernate.PropertyAccessException: could not get a field value by reflection getter of com.workcompanion.data.OVObjectives.persistenceId” }<

My objects are defined as follows:

  1. OVProfile
    a. OVObjectives
    i. ObjectiveDetails (Also an object)
    ii. Username
    iii. Quarter
    b. OVProjects
    i. ProjectDetails (Also an object)
    ii. Username
    iii. Quarter

The script says:

`//Initiate new profile
OVProfile newProfile = new OVProfile();

//Create list of new Objectives
List ObjList = new ArrayList ();
//Create list of new Projects
List ProjList = new ArrayList ();

String nPUName = initProfile.get(“uName”);
newProfile.setUserName(nPUName);
String npWPeriod = initProfile.get(“periodId”);
CommonWorkPeriod newWorkPeriod = commonWorkPeriodDAO.findByPeriodId(npWPeriod,0,1);
newProfile.setWorkPeriod(newWorkPeriod);

//Create Company Macro Objectives
List newMObjs = initProfile.get(“initMacroO”);
if (newMObjs!= null && newMObjs.size()>0){
for (Map line : newMObjs){
DetailMacroObjs macroObj = new DetailMacroObjs();
String macroOP = initProfile.get(“MOPriority”);
CommonPriority macroOPriority = commonPriorityDAO.findByPriorityId(macroOP,0,1);
macroObj.setMacroObjPriority(macroOPriority);
String macroOF = initProfile.get(“macroOFocus”);
CommonFocusTypes macroOFocus = commonFocusTypesDAO.findByFocusTypeId(macroOF,0,1);
macroObj.setMacroObjType(macroOFocus);
macroObj.setMacroObjDueDate(line.get(“MODue”));
macroObj.setMacroObjDescription(line.get(“MODesc”));
ObjList.add(macroObj);
}
newProfile.setObjectives(ObjList);
}

//Create initial Project list
List newProjects = initProfile.get(“initProjects”);
if (newProjects!= null && newProjects.size()>0){
for (Map line: newProjects){
DetailProjects projects = new DetailProjects();
String projP = initProfile.get(“pPriority”);
CommonPriority projPriority = commonPriorityDAO.findByPriorityId(projP,0,1);
projects.setProjectPriority(projPriority);
String projF = initProfile.get(“pFocus”);
CommonFocusTypes projFocus = commonFocusTypesDAO.findByFocusTypeId(projF,0,1);
projects.setProjectType(projFocus);
projects.setProjectDueDate(line.get(“pDue”));
projects.setProjectName(line.get(“pName”));
projects.setProjectDescription(line.get(“pDesc”));
ProjList.add(projects);
}
newProfile.setProjects(ProjList);
}
return newProfile;`

Could I also get a layman’s explanation about persistenceId’s?

Thank you, let me know if you need any other additional information.

I should also note the following from the bonita error log:

Caused by: java.lang.IllegalArgumentException: Can not set java.lang.Long field com.workcompanion.data.OVObjectives.persistenceId to com.workcompanion.data.DetailMacroObjs
at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:167)
at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:171)
at sun.reflect.UnsafeFieldAccessorImpl.ensureObj(UnsafeFieldAccessorImpl.java:58)
at sun.reflect.UnsafeObjectFieldAccessorImpl.get(UnsafeObjectFieldAccessorImpl.java:36)
at java.lang.reflect.Field.get(Field.java:393)
at org.hibernate.property.DirectPropertyAccessor$DirectGetter.get(DirectPropertyAccessor.java:59)
… 141 more

Hi, in my case this error was cause by zn exception raison on a form submission and which was not bern properly caught by the tool and when it arrived on the page the steps did not move. Review all your form fields cautiously.

Hi, I’m having the same error “could not get a field value by reflection getter of …”
Have you been able to resolve this problem.
Any answer would be highly appreciated.

Hi, Any update on this issue? I’m facing the same issuue.

Hi, In my case the error is on form submission only. I’m trying to set a list variable(which is another BDM) to the BDM in Operation. @srunjanally did you find any solution for the issue.