对于已成功构建的应用程序,我正在使用Grails 2.3.3。事务管理器中的GrailsContextLoader错误
我现在结合春季安全到应用程序中添加插件行:我收到有关transactionManager
和sessionfactory
这GrailsContextLoader错误
compile ":spring-security-core:2.0-RC5"
结果 - 以下是错误:
Error | 2017-10-13 12:46:09,299 [localhost-startStop-1] ERROR context.GrailsContextLoader - Error initializing the application: 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.hibernate.MappingException: Association references unmapped class: homevu1.PicturesNWShr Message: 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.hibernate.MappingException: Association references unmapped class: homevu1.PicturesNWShr
PicturesNWShr是我的一个领域,如果删除了spring-security插件,就没有问题了。
我扫描了一篇相关帖子,虽然我还没有找到一个具有相同问题的帖子。但是一些人建议对项目的根文件夹中的依赖文件进行修改,以强制或排除构建中的依赖关系。
我会欢迎一些建议吗?
这里是PicturesNWShr的域定义:
package homevu1
import java.util.Date;
class PicturesNWShr {
static constraints = {
name()
filename(blank: true, nullable: true)
dateCreated()
caption(blank: true, nullable: true)
slotType(blank: true, nullable: true)
groupName(blank: true, nullable: true)
}
static mapping = {
datasource 'publish'
}
String name
String filename
String caption
Date dateCreated
VideoSlotTypeShr slotType
String groupName // link pictures together for multifile upload
// ideal for linking al images of a house together for EAs.
Date updateDate // The multiple file upload process - checks each instance update is complete
// before adding to vidSlot.
static belongsTo = [userBT: UserShr]
String toString() {
"${name}"
}
}
-Mike
表明我们相关 – injecteer
类@injecteer增加了对PicturesNWShr域文件。 – mikek
使用2.0.0最终版本的插件'org.grails.plugins:spring-security-core:2.0.0' – saw303