I'm using Grails 2.3.3 for an application which has built successfully.
I'm now incorporating Spring security into the application adding the line in the plugins:
compile ":spring-security-core:2.0-RC5"
As a result I am getting this GrailsContextLoader error relating to transactionManager
and sessionfactory
- here is the error:
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 is one of my domains and there is no problem compiling it if the spring-security plugin is removed.
I have scanned a of related posts although I've not so far found one with an identical problem. But a number are suggesting making modifications to the dependency file in the root folder of the project in order to impose or exclude dependencies from the build.
I would welcome some suggestions?
Here is the domain definition of 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
org.grails.plugins:spring-security-core:2.0.0
– saw303