Tuesday, January 4, 2011

Running a Simple Ext GWT Application

Now that the holidays are over, I'm finally getting started with Ext GWT 2.0 Beginners Guide. I got the initial sample application running, but it took a little bit of doing.

For starters, I'm using IntelliJ IDEA (on Mac OS X 10.5, for the record), not Eclipse as suggested by the book. This wasn't too much of a problem. I only had to know how to:
  • set up the GWT SDK
  • add a global library for GXT
  • create a GWT project
Having the GXT library set up, I did not need to copy gxt.jar into war/WEB-INF/lib, and frankly I'm surprised that this is necessary in Eclipse; I may have to try that myself. I did, however, have to copy the GXT resources into my project as the book suggested. This also surprised me, but that's not the fault of the book. I'll have to check the official Ext GWT documentation to see if they take the same approach.

Finally, I thought I had everything set up and fired up development mode. When running the GXT version, it would crash with the error:
Invalid memory access of location 0x8 eip=0x4245eb
I switched back to the original non-GXT entry point and it worked fine. I finally realized that the one other difference in my project was that I had forgotten to change the Java SDK to 1.6. To be fair, the book says to use Java 6. I just didn't realize that it wouldn't work with Java 5.

What's the moral of this story? I'm not sure. I'm just glad it only took me 30 minutes to figure out, which I think is pretty fortunate given the obscurity of the error message.