PDA

View Full Version : NPE on Container



Kutu
5 Jun 2008, 1:09 PM
Not sure if this is on my side or not, but please take a look at this stack trace:

ERROR] Uncaught exception escaped
java.lang.NullPointerException: null
at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:443)
at com.google.gwt.dev.shell.ModuleSpace.invokeNativeVoid(ModuleSpace.java:235)
at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeVoid(JavaScriptHost.java:107)
at com.extjs.gxt.ui.client.util.WidgetHelper.doAttach(WidgetHelper.java:19)
at com.extjs.gxt.ui.client.widget.Container.doLayout(Container.java:241)
at com.extjs.gxt.ui.client.widget.Container.layout(Container.java:302)
at com.extjs.gxt.ui.client.widget.LayoutContainer.layout(LayoutContainer.java:234)
at com.extjs.gxt.ui.client.widget.Container.insert(Container.java:278)
at com.extjs.gxt.ui.client.widget.Container.add(Container.java:187)

I don't think this is on my side of code since this is deep down in GWT around a code where they do heavy reflection (it seems).

What might've caused this?

jeff.levine
5 Jun 2008, 1:34 PM
I saw this too, I couldn't pin down why it happened, but it seemed to happen after I attached a container to the center region in my border layout. When I went to remove the container, I hit the error.

I fixed it by using a ContentPanel instead of a Container, but it definitely seems like a bug, maybe in GWT, though.

Kutu
5 Jun 2008, 1:38 PM
I saw this too, I couldn't pin down why it happened, but it seemed to happen after I attached a container to the center region in my border layout. When I went to remove the container, I hit the error.


Yea, actually my code does this:

show(){
- removeAll()
- add(Container);
- setHeading();
}

The class that performs this extends ContentPanel and the ContentPanel is attached to the center region of BorderLayout. The difference is that it only occurs to one of the container that I added.

That show() code was supposed to work like a CardLayout to switch between containers.