How to debug ContextLoader - Failed to initialize context and BeanCreationException

I see several messages on various problems that people are having to resolve this problem: Context ERROR.ContextLoader - Context initialization error org.springframework.beans.factory.BeanCreationException:

Is there a way to enable debugging to isolate the problem?

He complains about β€œ There is no such property: getOrg for the class: groovy.lang.MetaClassImpl ”, but this is not direct for one of our classes, is there a way to get information related to our code base?

In our case, we had a Grails 1.2.1 application, deployed and working fine in Tomcat. Then we stopped Tomcat to backup the database, and then restarted the application. This same WAR without environmental changes (i.e. no changes to the configuration file, etc.) now causes this error. We observed this behavior intermittently before, but a restart was used to fix the problem.

In our development environment, the same application works fine with the "grails prod run-app" and also the "grails prod run-war".

Fragments of stacktrace:

2010-09-30 12: 10: 13,391 ERROR context.ContextLoader - Context Initialization error org.springframework.beans.factory.BeanCreationException: Error creating bean named 'messageSource': Initialization of bean failed; nested exception org.springframework.beans.factory.BeanCreationException: Error creating bean named "transactionManager": cannot resolve bean reference to 'sessionFactory' when setting the bean'SessionFactory 'property; nested exception org.springframework.beans.factory.BeanCreationException: Error creating bean named 'sessionFactory': init method call failed; groovy.lang.MissingPropertyException nested exception: There is no such property: getOrg for the class: groovy.lang.MetaClassImpl at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean.orgo .commons.spring.ReloadAwareAutowireCapableBeanFactory.doCreateBean (ReloadAwareAutowireCapableBeanFactory.java:129) on org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean (AbstractAutowireCapableBeanFactory.java:450) at org.springframework.beans.factory.support.AbstractBeanFactory $ 1. getObject (AbstractBeanFactory.java:290) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton (DefaultSingletonBeanRegistry.java:222)

<<<<<<<<snip β†’ β†’ β†’ β†’ β†’ β†’ β†’ β†’ β†’ β†’ β†’

Caused by: groovy.lang.MissingPropertyException: No such property: getOrg for class: groovy.lang.MetaClassImpl at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:49) at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.setProperty(ScriptBytecodeAdapter.java:485) at org.codehaus.groovy.grails.plugins.orm.hibernate.HibernatePluginSupport.handleLazyProxy(HibernatePluginSupport.groovy:413) at org.codehaus.groovy.grails.orm.hibernate.cfg.GrailsDomainBinder.bindProperty(GrailsDomainBinder.java:2108) at org.codehaus.groovy.grails.orm.hibernate.cfg.GrailsDomainBinder.createProperty(GrailsDomainBinder.java:1829) at org.codehaus.groovy.grails.orm.hibernate.cfg.GrailsDomainBinder.createClassProperties(GrailsDomainBinder.java:1565) at org.codehaus.groovy.grails.orm.hibernate.cfg.GrailsDomainBinder.bindJoinedSubClass(GrailsDomainBinder.java:1272) at org.codehaus.groovy.grails.orm.hibernate.cfg.GrailsDomainBinder.bindSubClass(GrailsDomainBinder.java:1219) at org.codehaus.groovy.grails.orm.hibernate.cfg.GrailsDomainBinder.bindSubClasses(GrailsDomainBinder.java:1186) at org.codehaus.groovy.grails.orm.hibernate.cfg.GrailsDomainBinder.bindRoot(GrailsDomainBinder.java:1160) at org.codehaus.groovy.grails.orm.hibernate.cfg.GrailsDomainBinder.bindClass(GrailsDomainBinder.java:1040) at org.codehaus.groovy.grails.orm.hibernate.cfg.GrailsAnnotationConfiguration.secondPassCompile(GrailsAnnotationConfiguration.java:145) at org.hibernate.cfg.Configuration.buildMappings(Configuration.java:1148) at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:717) at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:211) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1460) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1398) 
+2
java spring grails
source share
2 answers

If you set the logging level to DEBUG for the org.springframework and org.codehaus.groovy , you can get more detailed information.

But in the case of grails, sometimes it helps just stop tomcat, delete the work and temp directories, and start tomcat again.

+2
source share

I got this in grails 1.3.4, and deleting the tomcat and temp files ($ CATALINA_BASE / temp, $ CATALINA_BASE / work) seems to fix the problem.

+1
source share

All Articles