Skip to content

Beware collections with GWT 1.4 Final

I just upgraded our application to GWT 1.4.60, aka 1.4 Final. The upgrade was for the most part, pretty smooth. Only one issue reared its head. I have a number of objects that are Serializable that contain other Serializable objects. I had not marked them with the @gwt.typeArgs javadoc metadata, and things had worked just fine in GWT 1.4.10 (RC1). However, with 1.4 Final, I kept getting an InvocationException.

These tend to be real pains, because I’ve never seen them raised in code I write. Instead, they seem to arise from misconfiguration. Last time I saw one, I was compiling against the wrong version of gwt-servlet.jar.

This time, I hadn’t marked the contents of various Sets and Maps with the contents (using the aforementioned @gwt.typeArgs markup). I received warnings at compile time about that, but had received warnings with RC1 as well. I had, in typical developer fashion, noticed that the code still worked and thus ignored the warnings.Putting that markup in my code seemed to solve the problem.

There’s one thread on the groups about something similar to this. Here’s the tracking issue.