无法解析类通过延迟绑定 [英] Failed to resolve class via deferred binding

查看:189
本文介绍了无法解析类通过延迟绑定的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

// ...some imports

public class Menu {
    final MenuMaker myClass = GWT.create(MenuMaker.class);  // ERROR

我的... gwt.xml:

My ...gwt.xml:

...
<generate-with class="com.gwt.rebind.MenuGenerator">
  <when-type-assignable class="com.gwt.client.MenuMaker" />
</generate-with>
...

所有的工作完全当我运行编译DevMode的,但是当我建设与GWT编译器项目我得到这个错误:

All work perfectly when I run compile in DevMode but when I "Build the project with the GWT compiler" I get this error:

      [ERROR] Line 15:  Failed to resolve 'com.gwt.client.MenuMaker' via deferred binding
   Scanning for additional dependencies: jar:file:/C:/eclipse/plugins/com.google.gwt.eclipse.sdkbundle_2.4.0.v201208080121-rel-r42/gwt-2.4.0/gwt-user.jar!/com/google/gwt/dom/client/DOMImpl.java
      [WARN] For the following type(s), generated source was never committed (did you forget to call commit()?)
         [WARN] com.gwt.client.MenuMakerGen
   [ERROR] Cannot proceed due to previous errors

目前com.gwt.rebind.MenuGenerator的结尾:

At the end of com.gwt.rebind.MenuGenerator:

sourceWriter.commit(logger);

我需要帮助。

推荐答案

检查是否所有的客户端类有默认,零参数的构造函数。我有同样的延迟绑定的问题,而事实证明,我的一个类都没有默认构造函数。很奇怪,因为这个类甚至没有在GWT编译器日志中提及。

Check if all your client classes have default, zero-parameter constructor. I had the same "deferred binding" issue, and it turned out that one of my classes hadn't had default constructor. It was strange, because this class wasn't even mentioned in GWT compiler log.

这篇关于无法解析类通过延迟绑定的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆