I was playing around with the Spring/ExtJS Template on my Ubuntu box and ran into a strange problem. On the Vista laptop, if I compile with IntelliJ or from the command line with Ant, the application works perfectly fine when I deploy it to Tomcat. On the Ubuntu box, the WAR file generated by IntelliJ worked fine, but the WAR file output of the Ant script puked and died.
It took about an hour of hair pulling to figure out what the problem is. In the original build.xml file, the compile task looked like this:
Notice I didn’t specify and of the compiler, source or debug options. On Sun’s JDK 1.6.0_12 for Windows, debug appears to be the default. The Spring annotation needs the debug information for mapping parameter names in views.
On Linux, the same JDK (Sun 1.6.0_12) behaves differently. It does not include the debug information by default. In order to make my Ant build file work, I changed the compile attributes to this:
Explicitly defining debug=”true” resolved the issue. This is the first time I’ve bumped in to a basic behavioral difference for Java across operating systems. The lesson learned is play it safe and always specify compiler values.