gpt4 book ai didi

GWTP 无接口(interface)默认构造函数

转载 作者:行者123 更新时间:2023-12-01 20:19:59 26 4
gpt4 key购买 nike

谁能帮我解决一个问题吗?

我正在从 GWT 2.5.1 升级到 2.6.1,并且在尝试运行项目的代码服务器时收到以下错误...

[INFO] Compiling module <SOME_MODULE>
[INFO] Validating units:
[INFO] Ignored 1 unit with compilation errors in first pass.
[INFO] Compile with -strict or with -logLevel set to TRACE or DEBUG to see all errors.
[INFO] Computing all possible rebind results for 'com.gwtplatform.mvp.client.DesktopGinjector'
[INFO] Rebinding com.gwtplatform.mvp.client.DesktopGinjector
[INFO] Invoking generator com.google.gwt.inject.rebind.GinjectorGenerator
[INFO] [ERROR] Error injecting com.gwtplatform.mvp.client.proxy.PlaceManager: Unable to create or inherit binding: No @Inject or default constructor found for com.gwtplatform.mvp.client.proxy.PlaceManager
[INFO] Path to required node:
[INFO]
[INFO] com.gwtplatform.mvp.client.proxy.PlaceManager [com.gwtplatform.mvp.client.ClientGinjector#getPlaceManager()]
[INFO]
[...etc.]

看来 GIN 延迟绑定(bind)引擎正在尝试寻找接口(interface)上的构造函数,而这些构造函数当然不存在。

如有任何建议,我们将不胜感激。我正在使用 Maven。 http://mojo.codehaus.org/gwt-maven-plugin/

皮特

[编辑:]此特定错误是从 Gin 模块配置中删除此行的结果:

安装(new DefaultModule(DefaultPlaceManager.class));

该行已被删除,以尝试跟踪类似的错误。当我了解更多时,会发布更好的正式答案。

最佳答案

正如问题末尾所提到的,该错误是由于从模块配置中删除了重要的一行而导致的。但是,我试图修复的原始错误几乎是相同的,因此我的解决方案可能仍然有用......

对我来说,由于泛型的原因,代码无法通过 GWT 编译。问题是代码在 IDE 中编译得很好,但 GWT 编译 error message gets suppressed剩下的就是“1 个有编译错误的单元”。

我曾经找到的步骤是:

  1. 选择第一个错误并确定失败的绑定(bind)。您可能会注意到绑定(bind)失败的趋势。
  2. 转到实现(演示者/ View )并注释掉任何不重要的内容或删除父类。请记住,它只需要编译,不需要运行。
  3. 运行 clean+run-codeserver 调试周期有望导致第一个错误消失
  4. 一旦错误消失,就开始把东西放回去。就我而言,我发现父类导致了错误,因此我复制了整个类,并看到编译错误从“1 个单元”更改为“2 个单元”。
  5. 缩小代码范围(删除或注释掉)以查找错误代码行。
  6. 您应该能够从那里猜出问题所在。

关于GWTP 无接口(interface)默认构造函数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23883527/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com