Grails version 1.0.3 was recently released and if you blindly try and deploy this on to an old JBoss (I'm using 4.2.1) your deployment might fail giving you this trace:
Exception sending context initialized event to listener instance of class org.codehaus.groovy.grails.web.context.GrailsContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pluginManager' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: org/hibernate/annotations/common/reflection/ReflectionManager
at java.security.AccessController.doPrivileged(Native Method)
You'll need to add the following jars (which you could take from grails-1.0.3/lib if you wanted) to your JBoss server's lib directory...
- hibernate3.jar
- hibernate-annotations.jar
- hibernate-commons-annotations.jar
Why all three? Well, if you don't do all three you'll see...
Exception sending context initialized event to listener instance of class org.codehaus.groovy.grails.web.context.GrailsContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'messageSource': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager': Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory': Invocation of init method failed; nested exception is org.hibernate.AnnotationException: java.lang.NoSuchMethodException: org.hibernate.validator.ClassValidator.(java.lang.Class, java.util.ResourceBundle, org.hibernate.validator.MessageInterpolator, java.util.Map, org.hibernate.annotations.common.reflection.ReflectionManager)
... so drop all three in there and upgrade your JBoss server's version of Hibernate.

1 comments:
Don't forget to also get an updated copy of the hibernate-validator and hibernate-search JAR files. The hibernate-annotations.jar file included with JBoss contains packages not found in newer copies of hibernate-annotations (e.g., from a maven repository) such as "org.hibernate.search" and "org.hibernate.validator". Grails might work, but you'll likely break other deployed JEE applications without the additional JARs.
Post a Comment