“请求的 bean 当前正在创建”在域对象上
我正在尝试从 grails 1.2.2 迁移到 1.3.6,并在尝试访问页面时出现以下错误:
Error creating bean with name 'com.example.domain.UserAccount': Requested bean is currently in creation: Is there an unresolvable circular reference?
似乎 grails 试图将 UserAccount 实例化为 spring bean(可能是为了能够注入一些依赖项)。
grails 1.3.x 上是否存在一些与 1.2.x 不相关的约束?
谢谢&尊敬的,
大卫。
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 dependencies).
Is there some constraints that appears on grails 1.3.x that were not relevant on 1.2.x ?
Thanks & Regard,
David.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
问题来自 UserAccount 类中的一个属性:
this 引用在构造结束之前从对象构造中转义。
The problem was coming from a property in the UserAccount class :
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.