I am running 1.7.2 elasticsearch server and i'm using org.elasticsearch:elasticsearch-groovy:1.7.2 client to connect on it using TransportClient.
elasticsearch-groovy come 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 solution for this and currently i'm stuck. I would be very thankful for any hint.
This is my code:
I don't have any others lucene jars on classpath, and i could make it work with version 0.20.6, but i don't want use this old version. With elasticsearch 1.7.2 my problem still persists. For dependency i use gradle, and everyting is stored on my .m2 local repository.
[23/10/2015 11:52:39,385] ERROR errors.GrailsExceptionResolver - NoSuchFieldError occurred when processing request: [POST] /candidateDocument/uploadAjax/Xj6kf21 - parameters:
userFileDescription: dsfsdfsdf
userFileName: TODO.txt
LUCENE_3_6. Stacktrace follows:
org.codehaus.groovy.grails.web.servlet.mvc.exceptions.ControllerExecutionException: Executing action [uploadAjax] of controller [org.candidate.CandidateDocumentController] caused exception: Runtime error executing action
at grails.plugin.cache.web.filter.PageFragmentCachingFilter.doFilter(PageFragmentCachingFilter.java:198)
at grails.plugin.cache.web.filter.AbstractFilter.doFilter(AbstractFilter.java:63)
at grails.plugin.springsecurity.web.filter.GrailsAnonymousAuthenticationFilter.doFilter(GrailsAnonymousAuthenticationFilter.java:53)
at grails.plugin.springsecurity.web.authentication.RequestHolderAuthenticationFilter.doFilter(RequestHolderAuthenticationFilter.java:53)
at grails.plugin.springsecurity.web.authentication.logout.MutableLogoutFilter.doFilter(MutableLogoutFilter.java:62)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.codehaus.groovy.grails.web.servlet.mvc.exceptions.ControllerExecutionException: Runtime error executing action
... 8 more
Caused by: java.lang.reflect.InvocationTargetException
... 8 more
Caused by: java.lang.NoSuchFieldError: LUCENE_3_6
at org.elasticsearch.Version.(Version.java:43)
at org.elasticsearch.client.transport.TransportClient.(TransportClient.java:172)
at org.elasticsearch.client.transport.TransportClient.(TransportClient.java:125)
at org.elasticsearch.ElasticsearchFileService.put(ElasticsearchFileService.groovy:57)
at org.document.DocumentFacadeService.put(DocumentFacadeService.groovy:52)
at org.document.CandidateS3Service.$tt__put(CandidateS3Service.groovy:34)
at org.candidate.CandidateDocumentController.uploadAjax(CandidateDocumentController.groovy:85)
... 8 more
Because of unknown reasons gradle mixed jar versions of lucene. Where gradle couldn't find/download version of 4.10.4 of lucene, version 4.5.1 were downloaded, The solution was to add also lucene in my dependecies even elasticsearcg-groovy dependency depends on lucene 4.10.4.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.