使用grails配置Hibernate

时间:2014-06-20 08:18:37

标签: java spring hibernate grails

我创建了一个Grails应用程序并创建了设置到它的Spring Security插件。

当我运行应用程序时,我得到以下错误。 Hibernate文件夹为空。任何人都可以帮我解决这个问题吗?

2014-06-20 13:41:26,946 [http-bio-8080-exec-21] ERROR [/GrailsLoginWithSpring].[gsp]  - 
Servlet.service() for servlet [gsp] in context with path [/GrailsLoginWithSpring] threw exception
Message: org.springframework.beans.factory.BeanCreationException: 

Error creating bean with name 'org.grails.internal.SESSION_FACTORY_HOLDER': 
Cannot create inner bean '(inner bean)#3720a15d' of type 
[org.codehaus.groovy.grails.orm.hibernate.ConfigurableLocalSessionFactoryBean] 
while setting bean property 'sessionFactory'; 
nested exception is org.springframework.beans.factory.BeanCreationException: 

Error creating bean with name '(inner bean)#3720a15d': Invocation of init method failed; 
nested exception is java.io.FileNotFoundException: class path resource [hibernate.cfg.xml] 
cannot be resolved to URL because it does not exist

1 个答案:

答案 0 :(得分:0)

尝试添加

hibernate {
  reload = false
}

正如Graeme Rocher在JIRA

中所建议的那样