Grails 1.0.3 upgrade issues
Recently, we upgraded our application running in Grails 1.0.1 to 1.0.3. Just to give you an idea, the application is pretty complicated involving multiple data sources, complex hibernate mappings with JPA annotations, legacy system, linking tons of external services etc. We had to overcome few significant hurdles to get our application to run in Grails 1.0.3.
1. Update hibernate-entitymanager.jar (3.3.2 GA) in <project>/lib
2. Add hibernate-validator.jar (3.0.0 GA) in <project>/lib. Grails 1.0.1 did not require this jar
3. Changes to g:render taglib.
<g:render template=”templates/my_template.gsp” /> used to work in Grails 1.0.1 template file in _templates/my_template.gsp under grails-app/views/mycontroller/. Now, for Grails 1.0.3 you need to have the template in template/_my_template.gsp.
4. Issues with domain properties.
my_domain.properties = another_domain.properties. This doesn’t work anymore in Grails 1.0.3, at least in some cases. Had to manually copy properties.
5. There are definitely issues with complex hibernate mapping involving legacy system. A particular hibernate relationship was throwing javax.persistence.PersistenceException with Grails 1.0.3. We couldn’t figure out the actual reason, had to make the relationship transient and manually manage it.
6. Changes to taglib g:actionSubmitImage.
The following works fine in Grails 1.0.1.
<g:form name="myForm" action="myAction">
<g:actionSubmitImage value="Show" src=".." />
</g:form>
In Grails 1.0.3, you will need to change to <g:actionSubmitImage value="Show" src=".." action=”myAction” />
7. Issues with blank spaces in directories in Windows:
This is the nasty one and can drive you crazy. You may have problems running the app or executing tests. Errors such as java.util.zip.ZipException: The system cannot find the path specified or error trying to scan <jar-file> etc could be noticed. These errors are due to blank spaces in JAVA_HOME(c:\Program Files\..) and user.home (c:\Documents and Settings\..). To fix this:
- Re-install Java in directory without blank spaces (c:\Java\..)
- By default, the project is built in ${user.home}/.grails. We can change this location by specifying the user.home property in command-line such as grails -Duser.home=c:\ run-app or grails -Duser.home=c:\ test-app
Grails 1.0.3 seems much faster than Grails 1.0.1 and is probably worth the trouble.
Tags: Grails 1.0.3 upgrade