I am using Elasticsearch6.4 Java High Level REST Client.
I am using lucene-core-7.4.0.jar and lucene-queryparser-7.4.0.jar,
but im getting the following exception.
24-Oct-2018 11:43:31.164 SEVERE [http-nio-8080-exec-9] org.apache.catalina.core.StandardWrapperValve.invoke Servlet.service() for servlet [javax.ws.rs.core.Application] in context with path [/ws_Sanjay] threw exception [org.glassfish.jersey.server.ContainerException: java.lang.NoClassDefFoundError: org/apache/lucene/util/Version] with root cause
java.lang.ClassNotFoundException: org.apache.lucene.util.Version
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1333)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1167)
at org.elasticsearch.Version.(Version.java:47)
at org.elasticsearch.common.logging.DeprecationLogger.(DeprecationLogger.java:158)
at org.elasticsearch.action.search.SearchRequest.(SearchRequest.java:61)
at com.em.core.services.impl.SearchService.search(SearchService.java:94)
at com.em.core.services.SearchService.search(SearchService.java:48)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory.lambda$static$0(ResourceMethodInvocationHandlerFactory.java:76)
at org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:277)
at org.glassfish.jersey.internal.Errors$1.call(Errors.java:272)
at org.glassfish.jersey.internal.Errors$1.call(Errors.java:268)
at org.glassfish.jersey.internal.Errors.process(Errors.java:316)
at org.glassfish.jersey.internal.Errors.process(Errors.java:298)
at org.glassfish.jersey.internal.Errors.process(Errors.java:268)
at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:289)
at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:256)
at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:703)
at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:416)
at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:370)
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:389)
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:342)
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:229)
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:674)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1500)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1456)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:745)
When i searched for that exception, i came across a solution that lucene-core-xxx.jar would be missing along with some dependency jars. I already have lucene-core-7.4.0.jar.
asm-6.2.1.jar
aws-java-sdk-1.11.138.jar
BASE64Decoder.jar
batik-all-1.7.jar
cdi-api.jar
cglib-nodep-2.2.3.jar
commons-beanutils-1.8.3.jar
commons-httpclient-3.1.jar
commons-lang-2.4.jar
commons-math3-3.5.jar
commons-net-3.3.jar
commons-pool2-2.4.2.jar
concurrent-trees-2.4.0.jar
diffutils-1.3.0.jar
dom4j-1.6.1.jar
dropbox-core-sdk-3.0.3.jar
eclipselink-2.7.3.jar
ehcache-2.8.1.jar
elasticsearch-6.4.0.jar
elasticsearch-core-6.4.0.jar
elasticsearch-rest-client-6.4.0.jar
elasticsearch-rest-high-level-client-6.4.0.jar
elasticsearch-x-content-6.4.0.jar
evo-inflector-1.0.1.jar
ews-java-api-2.0.jar
geocode.jar
google-api-client-1.22.0.jar
google-api-client-servlet-1.22.0.jar
google-api-services-drive-v2-rev268-1.22.0.jar
google-api-services-drive-v3-rev71-1.22.0.jar
google-http-client-1.22.0.jar
google-http-client-jackson-1.22.0.jar
google-http-client-jackson2-1.22.0.jar
google-oauth-client-1.22.0.jar
google-oauth-client-java6-1.22.0.jar
google-oauth-client-jetty-1.22.0.jar
grammatica-1.5.jar
gson-2.2.4.jar
guava-14.0.1.jar
hibernate-c3p0-4.3.4.Final.jar
hk2-api-2.5.0-b62.jar
hk2-locator-2.5.0-b62.jar
hk2-utils-2.5.0-b62.jar
hppc-0.8.1.jar
httpasyncclient-4.1.4.jar
httpclient-4.5.3.jar
httpcore-4.4.6.jar
httpcore-nio-4.4.10.jar
itextpdf-5.5.6.jar
jackson-annotations-2.9.7.jar
jackson-core-2.9.7.jar
jackson-databind-2.9.7.jar
javax.inject-2.5.0-b42.jar
javax.websocket-api-1.0-rc4.jar
javax.websocket-api-1.1.jar
jaxrs-ri-2.27.jar
jboss-logging-3.3.2.Final.jar
jcommon-1.0.0.jar
jedis-2.8.0.jar
jersey-common-2.27.jar
jersey-container-servlet-core-2.27.jar
jersey-guava-2.26-b03.jar
jersey-hk2-2.27.jar
jersey-server-2.27.jar
jfreechart-1.0.1.jar
joda-time-2.8.jar
json-org.jar
json_simple-1.1.jar
jsoup-1.8.3.jar
jxl-2.6.12.jar
lang-mustache-client-6.4.0.jar
log4j-api-2.11.0.jar
log4j-core-2.11.0.jar
mibble-mibs-2.9.3.jar
mibble-parser-2.9.3.jar
mongo-2.10.1.jar
mpxj.jar
mybatis-3.4.6.jar
mysql-connector-java-8.0.12.jar
opencsv-2.3.jar
org.eclipse.persistence.core-2.7.3.jar
org.mortbay.jetty.server_6.1.22.jar
org.mortbay.jetty.util_6.1.22.jar
poi-3.10-beta2.jar
poi-ooxml-3.9.jar
poi-ooxml-schemas-3.7.jar
quartz-2.2.1.jar
rank-eval-client-6.4.0.jar
Rhino_1_7R4.jar
rztbase.jar
rztbuild.jar
shiro-core-1.2.3.jar
shiro-ehcache-1.2.3.jar
slf4j-api-1.7.6.jar
snmp6_0.jar
sonar-ant-task-1.3.jar
sqlite-jdbc-3.7.2.jar
thumbnailator-0.4.8.jar
validation-api-2.0.1.Final.jar
velocity-1.7.jar
xml-apis-ext-1.3.04.jar
xmlbeans-2.3.0.jar
xmlsec-1.3.0.jar
zip4j_1.3.2.jar
these are the other jars im using for my project.
Is there any dependency jar need to be added or any other solution will be there?
and also im getting
24-Oct-2018 13:10:01.768 SEVERE [http-nio-8080-exec-9] org.apache.catalina.core.StandardWrapperValve.invoke Servlet.service() for servlet [javax.ws.rs.core.Application] in context with path [/ws_Sanjay] threw exception [org.glassfish.jersey.server.ContainerException: java.lang.NoClassDefFoundError: Could not initialize class org.elasticsearch.action.search.SearchRequest] with root cause
java.lang.NoClassDefFoundError: Could not initialize class org.elasticsearch.action.search.SearchRequest
at com.em.core.services.impl.SearchService.search(SearchService.java:94)
at com.em.core.services.SearchService.search(SearchService.java:48)