Details
Description
We were testing a simple domain class for which we thought we had defined the following constraints
static constraints = { name(nullable: false, blank: false) }
but they were really set to this
static constraints = { name(nullable: false) }
The test code checked for both error messages but by the time we reached
assert !subject.validate() assert subject.errors['name'] == 'blank'
we got this exception instead
| java.lang.NoClassDefFoundError: javassist/util/proxy/MethodHandler at org.grails.datastore.mapping.model.AbstractMappingContext$DefaultProxyFactoryCreator.create(AbstractMappingContext.java:79) at org.grails.datastore.mapping.model.AbstractMappingContext.getProxyFactory(AbstractMappingContext.java:61) at org.grails.datastore.mapping.engine.EntityPersister.getProxyFactory(EntityPersister.java:67) at org.grails.datastore.mapping.engine.EntityPersister.getObjectIdentifier(EntityPersister.java:97) at org.grails.datastore.gorm.validation.constraints.UniqueConstraint.getIdentifier(UniqueConstraint.groovy:118) at org.grails.datastore.gorm.validation.constraints.UniqueConstraint$_processValidate_closure1.doCall(UniqueConstraint.groovy:42) at org.grails.datastore.gorm.validation.constraints.UniqueConstraint$_withManualFlushMode_closure2.doCall(UniqueConstraint.groovy:129) at org.grails.datastore.gorm.GormStaticApi$_withSession_closure17.doCall(GormStaticApi.groovy:543) at org.grails.datastore.mapping.core.DatastoreUtils.execute(DatastoreUtils.java:301) at org.grails.datastore.gorm.AbstractDatastoreApi.execute(AbstractDatastoreApi.groovy:34) at org.grails.datastore.gorm.GormStaticApi.withSession(GormStaticApi.groovy:542) at org.grails.datastore.gorm.validation.constraints.UniqueConstraint.withManualFlushMode(UniqueConstraint.groovy:125) at org.grails.datastore.gorm.validation.constraints.UniqueConstraint.processValidate(UniqueConstraint.groovy:39) at grails.test.MockUtils$_addValidateMethod_closure87.doCall(MockUtils.groovy:1017) at grails.test.MockUtils$_addValidateMethod_closure88.doCall(MockUtils.groovy:1060) at com.acme.FooTests.testConstraints(FooTests.groovy:32) Caused by: java.lang.ClassNotFoundException: javassist.util.proxy.MethodHandler at org.codehaus.groovy.tools.RootLoader.findClass(RootLoader.java:156) at java.lang.ClassLoader.loadClass(ClassLoader.java:306) at org.codehaus.groovy.tools.RootLoader.loadClass(RootLoader.java:128) at java.lang.ClassLoader.loadClass(ClassLoader.java:247) ... 16 more
I believe this is already fixed, but it would help if attached an example