0
작동하지 내가 가진 :GORM 복합 매핑 데이터베이스와 Grails의 2.4.3과 PostgreSQL에
class ClassA {
Set classB = []
static belongsTo = [classC: ClassC]
static hasMany = [classB: ClassB]
}
과 :
@EqualsAndHashCode
class ClassB implements Serializable {
ClassA classA
Integer number
static belongsTo = [classA: ClassA]
static mapping = {
id composite: ['number', 'classA']
}
그리고 나는이 이상한 오류 받고 있어요 :
[localhost-startStop-1] ERROR context.GrailsContextLoaderListener - Error initializin
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
java.lang.NullPointerException 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
java.lang.NullPointerException Line | Method ->> 266 | run in
java.util.concurrent.FutureTask - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - | 1142 | runWorker in java.util.concurrent.ThreadPoolExecutor | 617 |
run . . . in java.util.concurrent.ThreadPoolExecutor$Worker^745 | run in
java.lang.Thread
을
무슨 일 이니? 내가 뭘 잘못하고 있니?
질문에 잘못 쓴, 나는 실제 코드에 확인했다, 그것은 문제가되지 않습니다. –
ClassA에도'@ EqualsAndHashCode'를 적용 해보세요. – injecteer
'Serializable을 구현하는 것과하지 않고 동일한 것' –