java.lang.IllegalArgumentException: object is not an instance of declaring class


Solutions on the web

Solution icon of github
object is not an instance of declaring class

Stack trace

java.lang.IllegalArgumentException: object is not an instance of declaring class
	at groovy.lang.MetaBeanProperty.getProperty(MetaBeanProperty.java:62)
	at org.grails.validation.ConstrainedPropertyBuilder.doInvokeMethod(ConstrainedPropertyBuilder.java:74)
	at groovy.util.BuilderSupport.invokeMethod(BuilderSupport.java:67)
	at mypackage.TestDomainClass._clinit__closure1(TestDomainClass.groovy:7)
	at mypackage.TestDomainClass._clinit__closure1(TestDomainClass.groovy)
	at groovy.lang.Closure.call(Closure.java:414)
	at groovy.lang.Closure.call(Closure.java:408)
	at org.grails.validation.DefaultConstraintEvaluator.evaluateConstraintsMap(DefaultConstraintEvaluator.java:239)
	at org.grails.validation.DefaultConstraintEvaluator.evaluateConstraints(DefaultConstraintEvaluator.java:132)
	at org.grails.validation.DefaultConstraintEvaluator.evaluateConstraints(DefaultConstraintEvaluator.java:119)
	at org.grails.validation.DefaultConstraintEvaluator.evaluate(DefaultConstraintEvaluator.java:108)
	at org.grails.core.DefaultGrailsDomainClass.initializeConstraints(DefaultGrailsDomainClass.java:755)
	at org.grails.core.DefaultGrailsDomainClass.getConstrainedProperties(DefaultGrailsDomainClass.java:746)
	at org.grails.validation.GrailsDomainClassValidator.validate(GrailsDomainClassValidator.java:76)
	at org.grails.orm.hibernate.AbstractHibernateGormInstanceApi.save(AbstractHibernateGormInstanceApi.groovy:122)
	at org.grails.datastore.gorm.GormEntity$Trait$Helper.save(GormEntity.groovy:151)
	at mypackage.TestDomainClassSpec.$tt__$spock_feature_1_0(TestDomainClassSpec.groovy:15)

Write tip

You have a different solution? A short tip here would help you and many other users who saw this issue last week.

Users with the same issue

You are the first who have seen this exception. Write a tip to help other users and build your expert profile.