我看到有很多关于人们解决这个问题的问题的帖子:
错误context.ContextLoader – 上下文初始化失败org.springframework.beans.factory.BeanCreationException:
有没有办法打开调试来隔离问题?
它抱怨“没有这样的属性:getOrg for class:groovy.lang.MetaClassImpl”但是这不是我们类中的一个,是否有某种方法可以获得与我们的代码库相关的信息?
在我们的例子中,我们部署了一个Grails 1.2.1应用程序并在Tomcat中运行得很好.然后我们停止Tomcat进行数据库备份,然后重新启动应用程序.没有环境变化的相同WAR(即,没有配置文件更改等)现在抛出此错误.我们以前也间歇性地观察过这种行为,但重新启动用于修复概率.
在我们的开发环境中,同样的应用程序运行得很好,“grails prod run-app”以及“grails prod run-war”.
stacktrace片段:
2010-09-30 12:10:13,391 ERROR
context.ContextLoader – Context
initialization failed
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
groovy.lang.MissingPropertyException:
No such property: getOrg for class:
groovy.lang.MetaClassImpl
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
at org.codehaus.groovy.grails.commons.spring.ReloadAwareAutowireCapableBeanFactory.doCreateBean(ReloadAwareAutowireCapableBeanFactory.java:129)
at 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)