可以将一个节点从一个状态树移动到另一个状态树。如果是故意的,请首先通过调用removerfromtree从其当前状态树中删除节点

发布于 2025-02-12 03:37:51 字数 306 浏览 2 评论 0原文

当我从两个帐户登录到我的vaadin应用程序时,我会收到此错误消息

无法将节点从一个状态树移动到另一个状态树。如果是 故意,首先通过其当前状态树删除节点 调用removefromtree

了解有关调用错误的更多信息: 使用Google OAuth2登录 从用户A帐户登录到应用程序时,一切正常,一旦我同时从用户B的帐户登录应用程序,我

从消息中了解了一条错误消息,我有了常见的接口对象我必须为每个传入用户清理或创建新的,

也许有一些有关实现几个用户同时使用的应用程序的教程或类似的东西?

When I log in from two accounts to my vaadin app I get this error message

Can't move a node from one state tree to another. If this is
intentional, first remove the node from its current state tree by
calling removeFromTree

Learn more about calling the error:
Logging in with Google OAuth2
When logging in to the application from user A's account, everything works fine, as soon as I log in to the application from user B's account at the same time, I get an error message

As I understand from the message, I have common interface objects that I have to clean up or create new ones for each incoming user

Maybe there is some tutorial on implementing an application that is used by several users at the same time or something similar?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

岁月静好 2025-02-19 03:37:51

Vaadin不允许共享组件。这是在单个内部
UI状态树(该组件将被移动,而不是在
两个位置)。

对于在不同的不同之间共享组件尤其如此
UI状态树。结果是您到达那里的错误。

(偶然)共享组件的主要嫌疑人是:

  • 单例模式,static变量或仅此处的事物
    一次,例如enum s;通常情况下,开发人员只想保留一个
    周围或“保存”资源(例如不要说
    vaadinicons.cogs.create()在您的enum中。只是使用
    vaadinicons.cogs,然后在其上调用create(),每当您时
    将一个添加到UI。
  • 春季(或其他di)singleton,会议,...示意的东西。确保
    要查看关于春季的文档
    范围
    ;
    通常所有内容“下” @uiscope应该没问题(这也
    包括原型之类的“无害”范围。

还要注意,问题始终与组件一起
组件本身在其他组件之外使用的内容。没关系
具有原型:D Textfield使用Singleton I18NService

这些错误非常偷偷摸摸,因为开发人员往往只有
曾经通过一个会话/UI进行测试,并且一旦应用程序进入
居住。给定的错误消息实际上是没有用的
附带的调试器的应用程序。

Vaadin does not allow sharing components. This is true inside a single
UI state tree (the component will be moved instead of being visible on
two locations).

And this is especially true for sharing components between different
UI state trees. The result is the error you got there.

Prime suspects for (accidentally) sharing components are:

  • singleton patterns, static variables, or things, that are only there
    once, like enums; usually things, developers only want to keep one
    thing around or "save" resources (e.g. don't put
    VaadinIcons.COGS.create() in your enum. Just use
    VaadinIcons.COGS and then call the .create() on it, whenever you
    add one to the UI.
  • Spring (or other DI) singleton, session, ... scoped things. Make sure
    to check out the docs about the Spring
    scopes
    ;
    usually everything "under" @UIScope should be fine (this also
    includes "harmless" scopes like prototype.

Note also, that the problem is always with the component, not with
what the component itself uses outside of other components. So it's OK
to have a prototype:d TextField using a singleton I18NService.

Those kind of errors are quite sneaky, since developers tend to only
ever test with one session/UI and tend to creep up once the app goes
live. And the given error message is practically useless outside an
application with a debugger attached to it.

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