I get the following error when using a primitive attribute in my grails domain object:
Null value was assigned to a property of primitive type setter of MyDomain
According to this SO thread, the solution is to use the non-primitive wrapper types; e.g., Integer instead of int.
Integer
int