当尝试在Grails2.4.4应用程序上添加可搜索性:0.6.9(或较小的)时,我会得到hibernate4抛出的异常,但只有当我将“静态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 Line ->> 95 injectLifecycle in org.compass.gps.device.hibernate.HibernateGpsDevice 147doStart
,有人知道怎么做吗?
发布于 2014-12-02 17:06:21
显然,在这篇文章的标题中提到的插件不混合!GG景观变化迅速,搜索0.6.9不会与Hibernate 4握手。
解决办法?我目前正在考虑ElasticSearch,而不是新维护(事实上,从昨天起),并与新鲜插件很好地混合。它是否做了可搜索的功能,也就是说,最终会有一个搜索字段,用于从我的可搜索域类和/或可搜索属性中检索和显示记录?会发现并报告。
发布于 2014-11-20 22:09:31
我不认为这个可搜索的插件适用于Hibernate 4,但是您还没有声明依赖于任何版本的Hibernate,这肯定是行不通的。
在我的Grails 2.4.4应用程序中,我使用了以下版本的Hibernate插件的可搜索性
plugins {
runtime ':hibernate:3.6.10.18'
// other plugins
}https://stackoverflow.com/questions/27050416
复制相似问题