【问题标题】:GWTP Invalid attempt to reveal errorplace, but then works normallyGWTP 显示错误位置的尝试无效,但随后正常工作
【发布时间】:2015-04-01 13:44:36
【问题描述】:

我设置了几个位置,它们都可以正常工作,但由于此问题导致延迟除外。他们正在使用嵌套的演示者。 对于一个地方,似乎任何重复尝试加载它都会导致无限循环的显示错误/未经授权的地方(不知道为什么,没有设置看门人),但随后会正确加载页面。我遇到的问题是它导致的延迟和不必要的日志垃圾邮件 - 它正确加载页面,为什么不先经过循环就不能做到这一点?有人有什么想法吗?

-- 更新--

我将 GWTP 1.4 与 GWT 2.7.0 一起使用,但该项目最初是使用 GWTP 0.6 或更早版本创建的。我们在升级时更新了弃用等,但我知道还有不合时宜的地方。
我尝试使用默认值切换我们的 ClientPlaceManager,将 ErrorPlace 和 UnauthorizedPlace 绑定到我们的主页,并删除了它的看门人,但它仍然试图去错误的地方(覆盖revealErrorPlace 方法并注意到它为有效令牌抛出错误已经在该会话中至少加载了一次。特别是一页,没有任何演示者生命周期阶段正在触发,尽管演示者是可见的(我认为只是在 Firefox 中中断)。我真的不明白。

-- 更新 2--

我已经删除了看门人(甚至指定了@NoGatekeeper),确保错误/未经授权的地方有@NoGatekeeper 并且存在,并覆盖revealPlace(request, updateUrl) 以输出结果,并添加了一个try/catch - 它做同样的事情。一个无限循环,但一切都可以访问。我的调试输出甚至显示它试图揭示错误的地方,但它从来没有,只是出错了。 这真是令人沮丧。

堆栈跟踪:

SEVERE: Exception caught: Encountered repeated errors resulting in an infinite 
loop. Make sure all users have access to the pages revealed by revealErrorPlace 
and revealUnauthorizedPlace. (Note that the default implementations call 
revealDefaultPlace)
com.google.gwt.event.shared.UmbrellaException: Exception caught: 
Encountered repeated errors resulting in an infinite loop. Make sure all users 
have access to the pages revealed by revealErrorPlace and 
revealUnauthorizedPlace. (Note that the default implementations call 
revealDefaultPlace)
    at Unknown.fillInStackTrace_0_g$(student-0.js@36:10580)
    at Unknown.Throwable_3_g$(student-0.js@8:10535)
    at Unknown.Exception_3_g$(student-0.js@18:10678)
    at Unknown.RuntimeException_3_g$(student-0.js@18:61481)
    at Unknown.UmbrellaException_3_g$(student-0.js@25:133542)
    at Unknown.UmbrellaException_5_g$(student-0.js@26:133603)
    at Unknown.fireEvent_7_g$(student-0.js@13:133134)
    at Unknown.fireEvent_12_g$(student-0.js@22:154354)
    at Unknown.fire_8_g$(student-0.js@17:132936)
    at Unknown.fireValueChangedEvent_0_g$(student-0.js@3:154358)
    at Unknown.onHashChanged_0_g$(student-0.js@29:154297)
    at Unknown.apply_0_g$(student-0.js@28:109006)
    at Unknown.entry0_0_g$(student-0.js@16:109062)
    at Unknown.anonymous(student-0.js@14:109042)
Caused by: java.lang.RuntimeException: Encountered repeated errors resulting in 
an infinite loop. Make sure all users have access to the pages revealed by 
revealErrorPlace and revealUnauthorizedPlace. (Note that the default 
implementations call revealDefaultPlace)
    at Unknown.fillInStackTrace_0_g$(student-0.js@36:10580)
    at Unknown.Throwable_2_g$(student-0.js@8:10526)
    at Unknown.Exception_2_g$(student-0.js@18:10672)
    at Unknown.RuntimeException_2_g$(student-0.js@18:61475)
    at Unknown.startError_0_g$(student-0.js@11:92009)
    at Unknown.error_2_g$(student-0.js@8:91772)
    at Unknown.doRevealPlace_0_g$(student-0.js@10:91762)
    at Unknown.revealPlace_1_g$(student-0.js@8:91921)
    at Unknown.revealPlace_0_g$(student-0.js@8:91908)
    at Unknown.revealErrorPlace_1_g$(student-0.js@8:92109)
    at Unknown.error_2_g$(student-0.js@8:91773)
    at Unknown.doRevealPlace_0_g$(student-0.js@10:91762)
    at Unknown.handleTokenChange_0_g$(student-0.js@12:91848)
    at Unknown.onValueChange_4_g$(student-0.js@8:91888)
    at Unknown.dispatch_87_g$(student-0.js@16:132968)
    at Unknown.dispatch_88_g$(student-0.js@8:132972)
    at Unknown.dispatch_0_g$(student-0.js@8:49973)
    at Unknown.dispatchEvent_2_g$(student-0.js@14:133006)
    at Unknown.doFire_0_g$(student-0.js@9:133250)
    at Unknown.fireEvent_8_g$(student-0.js@8:133323)
    at Unknown.fireEvent_7_g$(student-0.js@25:133128)
    at Unknown.fireEvent_12_g$(student-0.js@22:154354)
    at Unknown.fire_8_g$(student-0.js@17:132936)
    at Unknown.fireValueChangedEvent_0_g$(student-0.js@3:154358)
    at Unknown.onHashChanged_0_g$(student-0.js@29:154297)
    at Unknown.apply_0_g$(student-0.js@28:109006)
    at Unknown.entry0_0_g$(student-0.js@16:109062)
    at Unknown.anonymous(student-0.js@14:109042)

【问题讨论】:

  • 您使用的是哪个版本的 GWTP?您是否设置了 DefaultGateKeeper?您是否从 prepareFromRequest 方法更改位置?
  • 我用版本和更多细节更新了问题,但我使用的是 GWTP 1.4 和 GWT 2.7.0。我第一次看到问题的页面/演示者没有设置网守,尽管我发现另一个页面在使用原始错误页面的浏览器后退按钮时抛出错误,并且它有一个网守。我删除了它,仍然没有运气。没有设置 DefaultGateKeeper。看起来这是一个错误,而不是未经授权的问题 - 但我不确定如何获取更多详细信息,我只是有堆栈跟踪告诉我某些事情出了问题

标签: gwt gwtp gwt-platform


【解决方案1】:

如果您使用的是 DefaultPlaceManager,请确保您已将 DefaultPlace、ErrorPlace 和 UnauthorizedPlace 绑定到 Gin 模块中的 Presenter 名称标记。 来自 DefaultPlaceManager 的 javadoc (http://arcbees.github.io/GWTP/javadoc/apidocs/com/gwtplatform/mvp/client/proxy/DefaultPlaceManager.html):

重要!如果你使用这个类,别忘了绑定 DefaultPlace, 将 ErrorPlace 和 UnauthorizedPlace 用于您的 Gin 中的 Presenter 名称令牌 模块。

注意:默认、错误和未授权的地方都是不公开的 更新浏览器的 URL(因此传入的 false 值 揭示地点)。这将避免步入无限导航 如果用户向后导航(使用浏览器的后退按钮),则循环。

以下是我们要避免的无限导航循环示例:

未经身份验证的命中#admin(保留给经过身份验证的位置 admins) #unauthorized 位置显示,浏览器的 URL 为 更新为#unauthorized 用户点击他的后退按钮 浏览器,登陆#admin,然后是#unauthorized,然后是#admin,依此类推。

另外,来自https://github.com/ArcBees/GWTP/issues/296

验证 Presenter 中代理的接口继承自 代理地点。

【讨论】:

  • 您好,感谢您的回复 - 我想真正的问题不是我为什么要循环(我知道,我真的应该有一个错误的地方等),但为什么它甚至显示错误?它会去一个有效的地方(覆盖revealErrorPlace并添加日志以获取错误令牌),但它试图揭示错误的地方,我不明白为什么
  • 我使用的是自定义 placemanager ClientPlaceManager,但在切换到默认位置并将位置绑定到没有网守的名称令牌时,我仍然遇到同样的问题
  • '验证 Presenter 中的代理接口是否继承自 ProxyPlace。'帮助了我 - 没有在 GWTP intellij 插件中检查“创建为位置” - 很难抓住,非常感谢!
猜你喜欢
  • 1970-01-01
  • 2014-01-18
  • 1970-01-01
  • 1970-01-01
  • 2022-11-02
  • 2023-01-25
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多