2019-08-13 22:56:45.466 ERROR --- [ restartedMain] o.s.b.web.embedded.tomcat.TomcatStarter : Error starting Tomcat context.
Exception: org.springframework.beans.factory.BeanCreationException.
Message: Error creating bean with name
'authenticationProcessingFilterDeregistrationBean': Cannot resolve
reference to bean 'authenticationProcessingFilter' while setting bean
property 'filter'; nested exception is
org.springframework.beans.factory.BeanCreationException: Error creating
bean with name 'authenticationProcessingFilter': Cannot resolve
reference to bean 'authenticationManager' while setting bean property
'authenticationManager'; nested exception is
org.springframework.beans.factory.BeanCreationException: Error creating
bean with name 'authenticationManager': Cannot resolve reference to
bean 'daoAuthenticationProvider' while setting constructor argument
with key [0]; nested exception is
org.springframework.beans.factory.BeanCreationException: Error creating
bean with name 'daoAuthenticationProvider': Cannot resolve reference to
bean 'userDetailsService' while setting bean property
'userDetailsService'; nested exception is
org.springframework.beans.factory.UnsatisfiedDependencyException: Error
creating bean with name 'userDetailsService': Unsatisfied dependency
expressed through method 'setTargetDatastore' parameter 0; nested
exception is org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'hibernateDatastore': Bean instantiation via constructor failed; nested exception is
org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.grails.orm.hibernate.HibernateDatastore]: Constructor
threw exception; nested exception is org.grails.datastore.mapping.model.IllegalMappingException: Non-existent mapping property [superior] specified for property [subordinadas] in class [motivacao.Estrategia]
我在 grails 4 中遇到上述错误。
此代码在 grails 2.5.6 中运行良好。
class Deeh extends Iniciativa {
SimNao estaAtiva
static constraints = {
instalacao (blank: false)
organizacao (blank: false)
superior (nullable: true)
risco (nullable: true)
recompensa (nullable: true)
objetivo (nullable: true)
estaAtiva (nullable: true)
resumo (nullable: true, unique:'instalacao', maxSize: 120)
detalhe (nullable: true, maxSize: 500, widget: 'textarea')
instalacao (blank: false)
meta (nullable: true)
objetivo (nullable: true)
estrategia (nullable: true)
tatica (nullable: true)
organizacao (blank: false)
naturezaIniciativa (blank: false)
tipoImpacto (nullable: true)
tipoUrgencia (nullable: true)
prioridade (nullable: true, length:2, maxSize:2)
prioridadeCalculada (editable:false, nullable: true, length:2, maxSize:2)
nivelAtuacao (blank: false)
riscos (nullable: true)
// estado (blank: false)
valorCentral (nullable: true)
responsavel (nullable: true)
previsaoDeInicio (nullable: true)
previsaoDeConclusao (nullable: true)
dataDeInicio (nullable: true)
dataDeConclusao (nullable: true)
subtitulo (nullable: true, maxSize:90)
custoGlobal (nullable: true)
nivelH (nullable: true)
superior (nullable: true)
previsaoDeInicio (nullable: true)
previsaoDeConclusao (nullable: true)
dataDeInicio (nullable: true)
dataDeConclusao (nullable: true)
gestor (nullable: true)
patrocinador (nullable: true)
subordinados (nullable: true)
acoes (nullable: true)
documentos (nullable: true)
percConclusaoCalc (nullable: true)
percConclusaoInfo (nullable: true)
}
Estrategia superior
Meta meta
Objetivo objetivo
Risco risco
RecompensaPotencial recompensa
static belongsTo = [Meta, Objetivo, Risco, Estrategia, Regra,
Risco, RecompensaPotencial]
Collection subordinadas, iniciativas, taticas, politicas
static hasMany = [subordinadas: Estrategia, iniciativas: Iniciativa,
taticas: Tatica, politicas: Politica]
static mappedBy = [objetivo:'estrategias',
iniciativas:'estrategia',
taticas:'estrategias',
subordinadas: 'superior']
static mapping = {
tablePerHierarchy false
estaAtiva (column: 'estaAtivo', type:SimNaoType)
superior (column: 'superior')
sort (dataInclusao:'desc', dataAlteracao:'desc' )
}
def afterInsert = {
super.afterInsert.run()
}
def afterUpdate = {
super.afterUpdate.run()
}
def beforeInsert = {
super.beforeInsert.run()
}
def beforeUpdate = {
super.beforeUpdate.run()
}
def afterDelete = {
// super.delete()
}
}