當試圖運行命令grails run-app --stacktrace
,Grails是引發此錯誤:ClassCastException異常的MappingFactory以一對多到Grails的3
org.springframework.beans.factory.BeanCreationException: 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.ClassCastException: org.grails.datastore.mapping.model.MappingFactory$10 cannot be cast to org.grails.datastore.mapping.model.types.ToMany
我評論static hasMany
從所有域類,但錯誤依然堅持着,直到我取代了它與Hibernate3的我build.gradle
我怎麼可以這樣使用hibernate4解決?
問題的解決方案是什麼? –
我來到這裏想知道@KevinTan同樣的事情 – genuinefafa