Failed to resolve class via deferred binding

burtsevyg picture burtsevyg · Dec 25, 2012 · Viewed 16.7k times · Source
// ...some imports

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

My ...gwt.xml:

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

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

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

sourceWriter.commit(logger);

I need help.

Answer

maciekb picture maciekb · Dec 3, 2013

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.