BZ.
BZ.

Reputation: 1946

Grails (v2.2) app starts via run-app, but dies when deploying the war on tomcat 7

I have a grails 2.2 app that runs fine when I do a clean checkout from svn and do grails run-app. (I've already blown away my .grails/2.2.0 and .grails/ivy-cache directories and re-downloaded the dependencies)

However, when I create the war (grails war) and deploy it in tomcat7, it dies with the following error:

2013-03-08 04:12:17,096 [pool-2-thread-1] ERROR StackTrace - Full Stack Trace: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManagerPostProcessor': 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.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.codehaus.groovy.grails.orm.hibernate.cfg.GrailsAnnotationConfiguration]: Constructor threw exception; nested exception is java.lang.NoSuchFieldError: INSTANCE at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:527)

I have the following plugins:

Any suggestions?

Upvotes: 0

Views: 842

Answers (1)

ataylor
ataylor

Reputation: 66099

Problems with the initialization of the transactionManagerPostProcessor bean are often issues with the dataSource.

Running grails run-app uses the development environment. Running grails war uses the production environment by default, so the problem may be the production dataSource configuration. If you want to build a warfile that uses the development mode settings, run grails -Dgrails.env=development war.

Upvotes: 0

Related Questions