'Requested bean is currently in creation' on a domain object
I'm trying to migrate from grails 1.2.2 to 1.3.6 and got the following error when trying to access a page :
Error creating bean with name 'com.example.domain.UserAccount': Requested bean is currently in creation: Is there an unresolvable circular reference?
It seems that grails tryed to instanciate UserAccount as a spring bean (probably to be able to inject some d开发者_JAVA百科ependencies).
Is there some constraints that appears on grails 1.3.x that were not relevant on 1.2.x ?
Thanks & Regard,
David.
The problem was coming from a property in the UserAccount class :
Program program = new Program(user:this)
The this reference was escaping from the object construction before the end of the construction.
Your best bet would be to read through the release notes for the versions between your old and new version used. If that does not shed any light, you might also consider doing incremental upgrades, one version at a time... that would be a big pain, but might be the more revealing way to upgrade.
Good luck.
精彩评论