org.hibernate.PropertyAccessException when opening a review
The following appears in the
atlassian-fisheye.log when opening a review:
2014-05-20 15:00:00,000 ERROR - Exception "org.hibernate.PropertyAccessException: Null value was assigned to a property of primitive type setter of com.cenqua.crucible.model.Patch.availableForAdding" (javax.servlet.ServletException) while processing "/review/cru/CR-1" (Referer:"http://localhost:8060/review/project/CR") javax.servlet.ServletException: org.hibernate.PropertyAccessException: Null value was assigned to a property of primitive type setter of com.cenqua.crucible.model.Patch.availableForAdding at com.opensymphony.webwork.dispatcher.DispatcherUtils.serviceAction(DispatcherUtils.java:285) at com.opensymphony.webwork.dispatcher.ServletDispatcher.service(ServletDispatcher.java:111) (...) Caused by: org.hibernate.PropertyAccessException: Null value was assigned to a property of primitive type setter of com.cenqua.crucible.model.Patch.availableForAdding at org.hibernate.property.BasicPropertyAccessor$BasicSetter.set(BasicPropertyAccessor.java:109) at org.hibernate.tuple.entity.AbstractEntityTuplizer.setPropertyValues(AbstractEntityTuplizer.java:586) (...) Caused by: java.lang.IllegalArgumentException at sun.reflect.GeneratedMethodAccessor1643.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.hibernate.property.BasicPropertyAccessor$BasicSetter.set(BasicPropertyAccessor.java:66) ... 202 more
This may happen after an upgrade from Fisheye/Crucible 2.x to 3.x, on the following condition:
- If a review was created from the old version after the database schema was upgraded, it will assign a NULL value to the column
cru_available_for_addof the table
cru_patchbecause this column was not present in the old version.
- This can also lead to Not a patch revision id error when opening a review.
- Check you have records with a NULL value in this column:
select * from cru_patch where cru_available_for_add is null
- Set this column to
truefor these records:
update cru_patch set cru_available_for_add=true where cru_available_for_add is null