Java.lang.NoSuchFieldError:LUCENE_3_6 [英] Java.lang.NoSuchFieldError: LUCENE_3_6
问题描述
elasticsearch-groovy带有elasticseach 1.7.2和lucene 4.10.4依赖。当TransportClient对象被初始化时,会抛出以下错误java.lang.NoSuchFieldError:LUCENE_3_6。我找不到解决方案,目前我被困住了。我会非常感谢任何暗示。
这是我的代码:
ImmutableSettings.Builder builder = ImmutableSettings.settingsBuilder()
builder.put (cluster.name,CLUSTER_NAME).put(client.transport.sniff,true)
设置设置= builder.build()
客户端=新的TransportClient(设置)
client.addTransportAddress(new InetSocketTransportAddress(127.0.0.1,9300))
IndexRequest indexRequest = new IndexRequest(tenant,table,id)
indexRequest.source(putJsonDocument(documentTitle,description,documentContent ,postDate,author))
client.index(indexRequest)
提前感谢! / p>
这可能是图书馆冲突。
做一个gradle依赖或者是等效的mvn命令,并寻找lucence库冲突。
对我而言,弹簧弹性搜索与hibernate搜索相冲突
I am running 1.7.2 elasticsearch server and I'm using org.elasticsearch:elasticsearch-groovy:1.7.2 client to connect to it using TransportClient. elasticsearch-groovy comes with elasticseach 1.7.2 and lucene 4.10.4 dependecy. When the TransportClient object is initialized the following error is thrown "java.lang.NoSuchFieldError: LUCENE_3_6". I couldn't find a solution for this and currently I'm stuck. I would be very thankful for any hint. This is my code:
ImmutableSettings.Builder builder = ImmutableSettings.settingsBuilder()
builder.put("cluster.name", CLUSTER_NAME).put("client.transport.sniff", true)
Settings settings = builder.build()
client = new TransportClient(settings)
client.addTransportAddress(new InetSocketTransportAddress("127.0.0.1", 9300))
IndexRequest indexRequest = new IndexRequest(tenant,table,id)
indexRequest.source(putJsonDocument(documentTitle,description, documentContent, postDate, author))
client.index(indexRequest)
Thanks in advance!
It's probably a library conflict.
Do a "gradle dependencies" or it's equivalent mvn command and look for lucence library clashes.
For me it turned out that spring elastic search was colliding with hibernate search
这篇关于Java.lang.NoSuchFieldError:LUCENE_3_6的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!