当尝试在Grails 2.4.4应用程序上添加searchable:0.6.9(或更小)时,我收到了hibernate4引发的异常,但这仅在将“ static searchable = true ”添加到我的域类时发生。
考虑到我的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-初始化应用程序时出错:org / hibernate / impl / SessionFactoryImpl消息:org / hibernate / impl / SessionFactoryImpl 方法->> 95 | org.compass.gps.device.hibernate.lifecycle.DefaultHibernateEntityLifecycleInjector 147中的injectLifecycle org.compass.gps.device.hibernate.HibernateGpsDevice中的doStart
有人知道如何使事情正常吗?
显然,这篇文章标题中提到的插件不能混用!GG格局瞬息万变,可搜索0.6.9不会与Hibernate 4握手。
解决方案?我目前正在考虑使用ElasticSearch-进行了最新维护(实际上截至昨天为止),并且与新插件很好地混合在一起。它是否执行Searchable的功能,即最终以一个搜索字段结束,该搜索字段可用于从我的可搜索域类和/或其中的可搜索属性中检索和显示记录?将找出并报告。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句