NullPointerException in GAE

Take the Window as defined below and add it to an Application. If you then select a line in the table and then click on the combo box drop-down under the table, you will get the NullPointerException shown below the class.

Please advise.

Thank you!
Scott

import com.vaadin.ui.Button;
import com.vaadin.ui.ComboBox;
import com.vaadin.ui.Table;
import com.vaadin.ui.Window;

public class TestWindow extends Window {

public TestWindow() {

    super("test");

    Table table = new Table();
    addComponent(table);
    table.setSelectable(true);
    table.setMultiSelect(true);

    table.addContainerProperty("First Name", String.class, null);
    table.addContainerProperty("Last Name", String.class, null);
    table.addContainerProperty("Age", Integer.class, null);
    table.addContainerProperty("Details", Button.class, null);

    table.addItem(new Object[] { "Nicolaus", "Copernicus", 10, new Button("1") }, 1);
    table.addItem(new Object[] { "Tycho", "Brahe", 12, new Button("2") }, 2);
    table.addItem(new Object[] { "Giordano", "Bruno", 8, new Button("3") }, 3);
    table.addItem(new Object[] { "Galileo", "Galilei", 14, new Button("4") }, 4);
    
    ComboBox submissions = new ComboBox();
    submissions.setNewItemsAllowed(false);
    submissions.setNullSelectionAllowed(false);
    addComponent(submissions);
    
    submissions.addItem("Submission 1");
    submissions.addItem("Submission 2");
    submissions.addItem("Submission 3");
}

}

java.lang.NullPointerException
at com.vaadin.ui.Table.getVisibleItemIds(Table.java:2760)
at com.vaadin.ui.AbstractSelect.changeVariables(AbstractSelect.java:414)
at com.vaadin.ui.Table.changeVariables(Table.java:1827)
at com.vaadin.terminal.gwt.server.CommunicationManager.handleVariables(CommunicationManager.java:738)
at com.vaadin.terminal.gwt.server.CommunicationManager.handleUidlRequest(CommunicationManager.java:287)
at com.vaadin.terminal.gwt.server.AbstractApplicationServlet.service(AbstractApplicationServlet.java:425)
at com.vaadin.terminal.gwt.server.GAEApplicationServlet.service(GAEApplicationServlet.java:231)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1093)
at com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:43)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
at com.google.appengine.tools.development.StaticFileFilter.doFilter(StaticFileFilter.java:121)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360)
at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:712)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
at com.google.apphosting.utils.jetty.DevAppEngineWebAppContext.handle(DevAppEngineWebAppContext.java:54)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
at com.google.appengine.tools.development.JettyContainerService$ApiProxyHandler.handle(JettyContainerService.java:313)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
at org.mortbay.jetty.Server.handle(Server.java:313)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:506)
at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:844)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:644)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:381)
at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:396)
at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:442)

I copied all the code into my test application, and couldn’t get an exception how ever I clicked on them. It sounds like a very strange bug when neither the table or the combobox has any listeners - they shouldn’t really act on any actions. I used Vaadin version 6.1.0, how about you?

Then again, I just noticed the topic of the thread. Is this a problem only when you deploy it to GAE or is it locally also a problem?

Hi,

The reason why the exception occurs when you click the ComboBox is because the Table is non-immediate - the selection is sent to the server when the ComboBox sends a request (‘piggyback’). If you say table.setImmediate(true), this should occur when you click the table.

So the problem seems to be with Table, but the reason is not immediately clear to me… How is your window attached to the application - setMainWindow()? Are you using and overridden Application.getWindow()?

I can see that the stacktrace comes from the GAE development server - does this problem occur when deployed to the ‘real’ GAE as well? This might be a serialization problem of some sort, perhaps only in the local environment - but I’m just guessing now…

Best Regards,
Marc

I tested this and it seems to be a problem with the multi select mode of the Table. When removing table.setMultiSelect(true); everything works fine. I created ticket
#3436
for this.

We seem to be 3 or 4 people testing this independently :slight_smile:

Some more info: this does indeed occur in GAE, both the local and ‘real’ GAE. It only occurs on a multi-select Table, and the reason is that the page buffer disappears (it’s not being serialized) and is not refreshed properly in this instance.

This is indeed a bug, thank you for noticing and providing a good example!

Best Regards,
Marc

Fantastic! I’m glad you were able to reproduce this issue and determine the cause. Thank you for your quick work on this!

Of course, you know the next question: When will I be able to have a fix? :smiley:

Thank you!
Scott

The ticket has been scheduled for 6.1.2 which is due next week.

Excellent, thank you. Please let me know when it’s available.

Best,
Scott

You can test the fix with the latest nightly builds if you are in a hurry. They are available through the Eclipse plugin or from
http://vaadin.com/download/nightly/
.

Otherwise, 6.1.2 is scheduled to be built late on Thursday and should be available on Friday.

Fantastic. I’ll wait for the release and let you know.

Best,
Scott

The new release works. Thanks!

Many thanks to all you guys who discovered and fixed this problem.
I am currently having this problem when testing on GAE. Now I know what to do.
-_-