简体   繁体   中英

Configuring Hibernate with grails

I have created created a Grails application and created the Spring Security plugin set up into It.

When I run the application I get following error. Hibernate folder is empty. Can anyone help me resolve this?

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

Try adding

hibernate {
  reload = false
}

As suggested by Graeme Rocher in this JIRA

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM