當試圖在Grails 2.4.4應用程序中添加可搜索的:0.6.9(或更少的)時,我得到了hibernate4拋出的異常,但這隻發生在我將「static searchable = true」添加到我的域類中。Grails 2.4.4 +搜索:0.6.9運行時問題
考慮到我的BuildConfig.groovy看起來像這樣:
repositories {
inherits true // Whether to inherit repository definitions from plugins
grailsPlugins()
grailsHome()
mavenLocal()
grailsCentral()
mavenCentral()
mavenRepo "https://repo.grails.org/grails/core"
mavenRepo "https://oss.sonatype.org/content/repositories/releases/"
mavenRepo "http://repo.spring.io/milestone"
}
dependencies {
compile "org.compass-project:compass:2.2.1"
compile('org.apache.lucene:lucene-highlighter:4.10.2',
'org.apache.lucene:lucene-spellchecker:3.6.2')
test "org.grails:grails-datastore-test-support:1.0.2-grails-2.4"
compile "javax.validation:validation-api:1.1.0.Final"
runtime "org.hibernate:hibernate-validator:5.0.3.Final"
}
plugins {
// plugins for the build system only
build ":tomcat:7.0.55"
// plugins for the compile step
compile ":scaffolding:2.1.2"
compile ':cache:1.1.8'
compile ":asset-pipeline:1.9.9"
runtime ":hibernate4:4.3.6.1" // or ":hibernate:3.6.10.18"
runtime ":database-migration:1.4.0"
runtime ":jquery:1.11.1"
runtime ":searchable:0.6.9"
}
我得到這個異常:
錯誤context.GrailsContextLoaderListener - 錯誤初始化應用程序:組織/休眠/ IMPL/SessionFactoryImpl 消息: org/hibernate/impl/SessionFactoryImpl Line |方法 - >> 95 | injectLifecycle在org.compass.gps.device.hibernate.lifecycle.DefaultHibernateEntityLifecycleInjector 147 DOSTART在org.compass.gps.device.hibernate.HibernateGpsDevice
是否有人知道如何使事情的工作嗎?
你是對的,但它只是在粘貼之前錯誤地刪除了依賴項「runtime」:hibernate4:4.3.6.1「」。我現在編輯我的原始帖子,以顯示我用來獲取該錯誤的確切設置。 我試過hibernate:3.6.10.18當然,但是我的應用程序甚至不會編譯!我正在使用JDK8u25,並且我在Windows 7和Mac OSX 10上都嘗試了這一點。我在使用較早的休眠時運行時遇到此問題: 消息:使用名稱'transactionManagerPostProcessor'創建bean時出錯:Bean初始化失敗;嵌套異常是org.springframework.beans.factory.BeanCreationException:... – mohsenmadi 2014-11-21 02:15:06