wtf nth

  • Archive
  • RSS

NullPointerException when initializing GWT’s UiBinder widget

I have a simple Composite that uses UiBinder. GWT was crashing on the following line:

public StartView() {
    initWidget(uiBinder.createAndBindUi(this)); // NullPointerException
}

StartView.ui.xml:

<g:VerticalPanel>
    <g:HorizontalPanel>
        <comp:FloorPicker />
        <g:HTMLPanel ui:field="gamePanel" />
        <comp:BuildMenu />
    </g:HorizontalPanel>
    <comp:FriendsPlaying />
</g:VerticalPanel>

The composites in comp were ones I had defined myself. They were simply empty composites:

public class FriendsPlaying extends Composite { }

Apparently GWT doesn’t like this. Solution: fill them out with the UiBinder boilerplate, and everything will work fine.

    • #GWT
  • 7 months ago
  • 1
  • Permalink
  • Share
    Tweet

1 Notes/ Hide

  1. publishingexc liked this
  2. wtfnth posted this
← Previous • Next →

About

stuff I learned the hard way

Pages

  • why
  • me
  • RSS
  • Random
  • Archive
  • Mobile

Effector Theme by Carlo Franco.

Powered by Tumblr