0
votes

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:

  • drools-gorm v0.5.6
  • joda-time v1.4
  • mail v1.0.1

Any suggestions?

1
Turns out to be an open issue with drools-gorm. There's an open jira issue for it at jira.grails.org/browse/…BZ.
This is related to dataSource. Please verify that you have put the right credentials for prod mode.Houcem Berrayana
It's the drools-gorm plugin, it works fine w/o that plugin (things persist to the db etc)BZ.

1 Answers

0
votes

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.