GWT 2.8 compile fails; 2.7 works

449 views
Skip to first unread message

jgindin

unread,
Nov 21, 2016, 4:07:42 PM11/21/16
to GWT Users
In our app, we have a UiBinder widget (SomeViewImpl) which has, as its root element, a widget which itself is a UiBinder widget (CollectionManagementLayout).

My UiBinder declaration in SomeViewImpl looks like this:
interface CollectionManagementPanelUiBinder extends UiBinder<CollectionManagementLayout, SomeViewImpl> {}


The UiBinder XML for the SomeViewImpl class starts off like this:
  <collectionmanagement:CollectionManagementLayout ui:field="layout">
    . . . 
  </collectionmanagement:CollectionManagementLayout>



This code compiles just fine in GWT 2.7, but with 2.8, I get the following error:

[ERROR] Errors in 'generated://09CDEAB17C92C8C75AB00C9F2F0DF847/com/myco/myproduct/client/stuff/collections/SomeViewImpl_CollectionManagementPanelUiBinderImpl.java'
      [ERROR] Line 17: The interface UiBinder cannot be implemented more than once with different arguments: UiBinder<CollectionManagementLayout,SomeViewImpl> and UiBinder<CollectionManagementLayout,SomeViewImpl>
      See snapshot: /tmp/com.myco.myproduct.client.stuff.collections.SomeViewImpl_CollectionManagementPanelUiBinderImpl3472216513944602205.java
   Tracing compile failure path for type 'com.myco.myproduct.client.stuff.collections.SomeViewImpl_CollectionManagementPanelUiBinderImpl'
      [ERROR] Errors in 'generated://09CDEAB17C92C8C75AB00C9F2F0DF847/com/myco/myproduct/client/stuff/collections/SomeViewImpl_CollectionManagementPanelUiBinderImpl.java'
         [ERROR] Line 17: The interface UiBinder cannot be implemented more than once with different arguments: UiBinder<CollectionManagementLayout,SomeViewImpl> and UiBinder<CollectionManagementLayout,SomeViewImpl>



The generated code looks like this:
public class SomeViewImpl_CollectionManagementPanelUiBinderImpl 
  implements UiBinder<CollectionManagementLayout, SomeViewImpl>, 
  SomeViewImpl.CollectionManagementPanelUiBinder {


I worked around this by changing the UiBinder declaration in SomeViewImpl to be:
interface CollectionManagementPanelUiBinder extends UiBinder<Widget, SomeViewImpl> {}


My question is: Should this have failed in GWT 2.7? Or is there a bug in GWT 2.8?

thanks,

jay

Velusamy Velu

unread,
Nov 22, 2016, 10:12:27 AM11/22/16
to GWT Users
This may or may not help you but I want to share it with you. The moment GWT 2.8 release was announced I tried it and ran into similar problems. I don't remember the exact error messages but it was about the UiBinder. Without further attempts I just gave up. After seeing your post I gave it a try and this time it worked. I have no clue what fixed other than a clean build.

Velusamy Velu

unread,
Nov 30, 2016, 2:45:35 PM11/30/16
to GWT Users
Oops! I do get the error. I was wrong when I said it worked for me. When I attempted to change the GWT version from 2.7.0 to 2.8.0 in eclipse, eclipse switched it back to 2.7.0 for reasons I cannot figure out. Given below are the offending UiBinder code, the corresponding Java code, and the stack trace when switching a running application from GWT 2.7 to 2.8. Any help would be greatly appreciated.

<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
  xmlns:g="urn:import:com.google.gwt.user.client.ui"
 
xmlns:m="urn:import:gwt.material.design.client.ui">
 
<g:HTMLPanel>
   
<g:PopupPanel ui:field="launchPad" styleName="launch">
          <m:MaterialColumn ui:field="container" shadow="3">
                  <!-- Dialog title -->
                  <m:MaterialPanel styleName="centeredContentDiv peruseStandardBackground noPadding">
                    <m:MaterialLabel styleName="launchTitle">PeruseLab - Loading your drawings...</m:MaterialLabel>
                    <m:MaterialProgress type="INDETERMINATE" enabled="false" ui:field="progressBar" />
                    <!-- The above shows the progress bar while retrieving drawing(s) for user -->
                  </m:MaterialPanel>
               </m:MaterialColumn>
            </g:PopupPanel>
      </g:HTMLPanel>
</ui:UiBinder>

public class Loader extends Composite {

   
interface LoaderUiBinder extends UiBinder<Widget, Loader> {
   
}

    
private static LoaderUiBinder uiBinder = GWT.create(LoaderUiBinder.class);

   
@UiField
   
PopupPanel launchPad;

    
@UiField
   
MaterialColumn container;

    
public Loader() {
        initWidget
(uiBinder.createAndBindUi(this));
   
}

    public void hide() {
        clear
();
        launchPad
.hide(true);
   
}

   
public void show() {
        launchPad
.show();
   
}

    private void clear() {
       
while (container.getWidgetCount() > 0) {
            container
.remove(0);
       
}
   
}
}


Caused by: java.lang.NoSuchMethodError: com.google.gwt.uibinder.rebind.UiBinderWriter.<init>(Lcom/google/gwt/core/ext/typeinfo/JClassType;Ljava/lang/String;Ljava/lang/String;Lcom/google/gwt/core/ext/typeinfo/TypeOracle;Lcom/google/gwt/uibinder/rebind/MortalLogger;Lcom/google/gwt/uibinder/rebind/FieldManager;Lcom/google/gwt/uibinder/rebind/messages/MessagesWriter;Lcom/google/gwt/uibinder/rebind/DesignTimeUtils;Lcom/google/gwt/uibinder/rebind/UiBinderContext;ZZLjava/lang/String;Lcom/google/gwt/dev/resource/ResourceOracle;Lcom/google/gwt/resources/rg/GssResourceGenerator$GssOptions;)V
 at com
.google.gwt.uibinder.rebind.UiBinderGenerator.generateOnce(UiBinderGenerator.java:174)
 at com
.google.gwt.uibinder.rebind.UiBinderGenerator.generate(UiBinderGenerator.java:128)
 at com
.google.gwt.core.ext.IncrementalGenerator.generateNonIncrementally(IncrementalGenerator.java:40)
 at com
.google.gwt.dev.javac.StandardGeneratorContext.runGeneratorIncrementally(StandardGeneratorContext.java:745)
 at com
.google.gwt.dev.cfg.RuleGenerateWith.realize(RuleGenerateWith.java:103)
 at com
.google.gwt.dev.shell.StandardRebindOracle$Rebinder.rebind(StandardRebindOracle.java:78)
 at com
.google.gwt.dev.shell.StandardRebindOracle.rebind(StandardRebindOracle.java:262)
 at com
.google.gwt.dev.shell.StandardRebindOracle.rebind(StandardRebindOracle.java:251)
 at com
.google.gwt.dev.PrecompilationContextCreator$1.getAllPossibleRebindAnswers(PrecompilationContextCreator.java:86)
 at com
.google.gwt.dev.jjs.impl.UnifyAst$UnifyVisitor.createStaticRebindExpression(UnifyAst.java:519)
 at com
.google.gwt.dev.jjs.impl.UnifyAst$UnifyVisitor.createRebindExpression(UnifyAst.java:487)
 at com
.google.gwt.dev.jjs.impl.UnifyAst$UnifyVisitor.maybeHandleMagicMethodCall(UnifyAst.java:415)
 at com
.google.gwt.dev.jjs.impl.UnifyAst$UnifyVisitor.visit(UnifyAst.java:402)
 at com
.google.gwt.dev.jjs.ast.JMethodCall.traverse(JMethodCall.java:265)
 at com
.google.gwt.dev.jjs.ast.JModVisitor.traverse(JModVisitor.java:361)
 at com
.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:273)
 
... 46 more
           
[ERROR] at Loader.java(29): GWT.create(Loader$LoaderUiBinder.class)
               com
.google.gwt.dev.jjs.ast.JMethodCall
           
[ERROR] at Loader.java(29): (Loader$LoaderUiBinder) GWT.create(Loader$LoaderUiBinder.class)
               com
.google.gwt.dev.jjs.ast.JCastOperation
           
[ERROR] at Loader.java(29): static Loader$LoaderUiBinder uiBinder = (Loader$LoaderUiBinder) GWT.create(Loader$LoaderUiBinder.class)
               com
.google.gwt.dev.jjs.ast.JDeclarationStatement
           
[ERROR] at Loader.java(24): {
 
Composite.$clinit();
 
static Loader$LoaderUiBinder uiBinder = (Loader$LoaderUiBinder) GWT.create(Loader$LoaderUiBinder.class);
}
               com
.google.gwt.dev.jjs.ast.JBlock
           
[ERROR] at Loader.java(24): {
 
Composite.$clinit();
 
static Loader$LoaderUiBinder uiBinder = (Loader$LoaderUiBinder) GWT.create(Loader$LoaderUiBinder.class);
}
               com
.google.gwt.dev.jjs.ast.JMethodBody
           
[ERROR] at Loader.java(24): com.snkv.peruse.client.Loader.$clinit()V
               com
.google.gwt.dev.jjs.ast.JMethod
     
[ERROR] Compiler returned false
     
[WARN] recompile failed


On Monday, November 21, 2016 at 4:07:42 PM UTC-5, jgindin wrote:

Velusamy Velu

unread,
Nov 30, 2016, 2:48:47 PM11/30/16
to GWT Users
Here's the remainder of the stack trace


 at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:273)
 
... 46 more
           
[ERROR] at Loader.java(29): GWT.create(Loader$LoaderUiBinder.class)
               com
.google.gwt.dev.jjs.ast.JMethodCall
           
[ERROR] at Loader.java(29): (Loader$LoaderUiBinder) GWT.create(Loader$LoaderUiBinder.class)
               com
.google.gwt.dev.jjs.ast.JCastOperation
           
[ERROR] at Loader.java(29): static Loader$LoaderUiBinder uiBinder = (Loader$LoaderUiBinder) GWT.create(Loader$LoaderUiBinder.class)
               com
.google.gwt.dev.jjs.ast.JDeclarationStatement
           
[ERROR] at Loader.java(24): {
 
Composite.$clinit();
 
static Loader$LoaderUiBinder uiBinder = (Loader$LoaderUiBinder) GWT.create(Loader$LoaderUiBinder.class);
}
               com
.google.gwt.dev.jjs.ast.JBlock
           
[ERROR] at Loader.java(24): {
 
Composite.$clinit();
 
static Loader$LoaderUiBinder uiBinder = (Loader$LoaderUiBinder) GWT.create(Loader$LoaderUiBinder.class);
}
               com
.google.gwt.dev.jjs.ast.JMethodBody
           
[ERROR] at Loader.java(24): com.snkv.peruse.client.Loader.$clinit()V
               com
.google.gwt.dev.jjs.ast.JMethod
     
[ERROR] Compiler returned false



 at com
.google.<span style="color: #000;" class="styled-by-pret

Jens

unread,
Nov 30, 2016, 3:23:43 PM11/30/16
to GWT Users

Oops! I do get the error.

Your error is a different one. Your error means you either have GWT 2.7 and 2.8 on classpath or some of your 3rd party libraries have bundled some older copies of UiBinder generator files.

-- J.

Jens

unread,
Nov 30, 2016, 3:26:02 PM11/30/16
to GWT Users

My question is: Should this have failed in GWT 2.7? Or is there a bug in GWT 2.8?

Given that the error message

The interface UiBinder cannot be implemented more than once with different arguments: UiBinder<CollectionManagementLayout,SomeViewImpl> and UiBinder<CollectionManagementLayout,SomeViewImpl>

already sounds dumb (arguments are both the same and not different), I would guess its a bug. If you can create a small, self contained example project that demonstrates the issue you should file a bug on github.

-- J.
Reply all
Reply to author
Forward
0 new messages