gpt4 book ai didi

grails - 设置 “user-type”类型时出错:org.jadira.usertype.dateandtime.joda.PersistentDateTime

转载 作者:行者123 更新时间:2023-12-02 13:51:39 26 4
gpt4 key购买 nike

我是Grails(2.4.1)的新手。我正在尝试使用乔达时间(1.5)。当我将下面的脚本放入Config.groovy时,发生错误。

grails.gorm.default.mapping = {
"user-type" type: org.jadira.usertype.dateandtime.joda.PersistentDateTime, class: org.joda.time.DateTime
"user-type" type: org.jadira.usertype.dateandtime.joda.PersistentLocalDate, class: org.joda.time.LocalDate
// … define as many other user type mappings as you need
}

error: Error | 2014-07-12 23:45:31,632 [localhost-startStop-1] ERROR context.GrailsContextLoaderListener - 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 java.lang.NoClassDefFoundError: org/hibernate/engine/SessionImplementor 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.NoClassDefFoundError: org/hibernate/engine/SessionImplementor



等等

最佳答案

我通过升级插件使用的Jadira Usertype库依赖关系来修复了相同的错误。

Joda Time插件建议使用“org.jadira.usertype:usertype.jodatime:1.9”,它仅适用于Hibernate3。尝试使用Hibernate 4时切换至“org.jadira.usertype:usertype.core:3.2.0.GA” 。

关于grails - 设置 “user-type”类型时出错:org.jadira.usertype.dateandtime.joda.PersistentDateTime,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24719178/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com