Having the NPE problem during view initialization I determined that
this element

@UiField(provided=true)
ShortMessageBox shortMessageBox;

causes it. When I remove it from the view everything works fine.

The ShortMessageBox is defined UIBinder-based componet:

public class ShortMessageBox extends Composite {

          public interface ShortMessageBoxUiBinder extends UiBinder<Widget,
ShortMessageBox> {
          }

          @Inject
          public ShortMessageBox(final ShortMessageBoxUiBinder
uiBinder) {
                  super();

                  initWidget(uiBinder.createAndBindUi(this));
                  clearMessageWidget();
          }
          ....
}

As you can see I am using gin but I have other similarly defined
components that work just fine. Since I am not looking for solution
with this question I don't provide all supporting code.

The question is how to troubleshoot/debug UIBinder views and
components when the following exception encountered during
initialization:

Caused by: java.lang.NullPointerException
        at
com.myapp.client.ui.ShortMessageBox_ShortMessageBoxUiBinderImpl.createAndBindUi(ShortMessageBox_ShortMessageBoxUiBinderImpl.java:
18)
        at
com.myapp.client.ui.ShortMessageBox_ShortMessageBoxUiBinderImpl.createAndBindUi(ShortMessageBox_ShortMessageBoxUiBinderImpl.java:
1)
        at com.myapp.client.ui.ShortMessageBox.<init>(ShortMessageBox.java:
33)
        at com.myapp.client.gin.MyAppGinjectorImpl.com$myapp$client$ui
$ShortMessageBox_ShortMessageBox_methodInjection(MyAppGinjectorImpl.java:
1058)


My problem is that something obviously going wrong during
ShortMessageBox initialization but no detailed information or ways to
debug it that I know of...

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to