“请求的 bean 当前正在创建”在域对象上

发布于 2024-10-10 01:36:43 字数 374 浏览 6 评论 0原文

我正在尝试从 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

不忘初心 2024-10-17 01:36:43

问题来自 UserAccount 类中的一个属性:

Program program = new Program(user:this)

this 引用在构造结束之前从对象构造中转义。

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.

作死小能手 2024-10-17 01:36:43

您最好的选择是通读您所使用的旧版本和新版本之间版本的发行说明。如果这没有带来任何启发,您可能还可以考虑进行增量升级,一次一个版本......这将是一个很大的痛苦,但可能是更具有启发性的升级方式。

祝你好运。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文