對於已成功構建的應用程序,我正在使用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