Create a WAR file for a GWT application

After I was so spoiled by GWT/Eclipse’s streamlined way of deploying a GWT application to the embedded server or Google App Engine, I was annoyed by how little support it has for other application servers. Fortunately, I was able to semi-automatically generate a WAR file for manual deployment on a remote server by following this tutorial :)

Back when I was working with Netbeans, deployment to a remote server was as simple as a single mouse click. On Eclipse, deployment to a remote server appears to be discouraged.

GWT SimplePager

It’s unfortunate that my initial experience with GWT’s SimplePager wasn’t very positive. The paging behaviour toward end of the list showed the following:

  1. For the last page, pager would attempt to request record count at last index + page size. This would cause pager to go index array out of bound. i.e. Let’s say you have 95 records with a page size of 10. The last page’s record index should be 90. If you add page size to it, you get 100. Requesting records between 90 and 100 caused the index array out of bound exception.
  2. If you use next page button navigate to the last page, it would display the last page in a way that the pager would fill the last page with a number of records the same as page size, no matter how many total records are. This created a very weird user experience. i.e For the same parameters above, you would see records #80-90 on the second to last page and then #85-95 on the last page.

After looking on-line for answers, I came across this thread and it helped me to resolve the issues that I observed above. :)

Using Subversion externals for files

I needed to use Subversion externals property to define a reference to a file. Based on this blog, here are my notes:

Let’s say that you want to have Subversion to use the following file from another directory:

And have the file download into the following file in your project: myproject/lib/thelib.jar You should have lib directory already exist.

Within your myproject folder, create a text file. This is necessary if you plan to have multiple references.

$ cat > svn_externals_config.txt

Use Ctrl-D to exit the data entry mode. Alternatively, you can use your favourite text editor to create the text file.

If you want to reference a folder instead, you can have the following definition:


Make sure that the local lib folder doesn’t have aThirdPartyLibFolder or you may get the following error: svn: warning: Working copy 'aThirdPartyLibFolder' locked.

Now you can set the svn:externals property by running the following lines:

svn propset svn:externals . -F svn_externals_config.txt
svn update

Once you are set, you can commit the externals definition by running the following command:

svn commit --depth empty . -m "Modify svn externals definition only."

Subclipse on Fedora

Update 20110926: In Fedora 15, you can just install subversion-javahl-1.6.17-1.fc15 from Add/Remove Software tool, much easier than the method described earlier. :)

When trying to run Subclipse, I got the following error: Failed to load JavaHL Library. To get JavaHL loaded for Subclipse on Fedora, I had to first register on Collabnet before attempt to install JavaHL rpm from this location. Once installed, I had to run export LD_LIBRARY_PATH=/opt/CollabNet_Subversion/lib on the command line before running eclipse.

This above tip is the result of combining the howto from this and this page.

JavaOne 2010 Related Links

Here are some information that I found on the net about JavaOne 2010. Feel free to comment with additional resources. To start, Oracle posted some video highlights. If you have JavaOne login, you can view the full versions at On Demand site. If not, you can still see some of the contents here. Beyond that, here are posts from various speakers on their talks and related links.