JBoss Community

Invalid JPA definition for ProcessInstanceLog v5.4.0, leads to Hibernate exception

created by Julien Serdaru in jBPM - View the full discussion

Hello, there. I see that the ProcessInstanceLog class has been modified between 5.3.0 and 5.4.0. The following persistent properties have been added:

 

@Column(nullable=true)private int status;@Column(nullable=true)private long parentProcessInstanceId;@Column(nullable=true)private String outcome;

 

However, I think having a nullable property with a primitive type is not going to work when loading data with the "parentProcessInstanceId" or "status" having null values (which happens in my case).

 

Hibernate complains:

 

Caused by: java.lang.IllegalArgumentException: Can not set long field org.jbpm.process.audit.ProcessInstanceLog.parentProcessInstanceId to null value

    at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:146)

    at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:150)

    at sun.reflect.UnsafeLongFieldAccessorImpl.set(UnsafeLongFieldAccessorImpl.java:62)

    at java.lang.reflect.Field.set(Field.java:657)

    at org.hibernate.property.DirectPropertyAccessor$DirectSetter.set(DirectPropertyAccessor.java:139)

 

I think a simple fix would be to substitute int with Integer, long with Long, and modifiy the setter/getter methods accordingly.

 

Am i the only one with the problem? Should I open an issue on Jira?

 

Thanks for your help.

Reply to this message by going to Community

Start a new discussion in jBPM at Community