问题
I am using elasticsearch-rest-high-level client 6.4.0 in my application, I have added all the dependant jars from lucene as listed in maven.
This is the error I am getting
[org.glassfish.jersey.server.ContainerException: java.lang.NoClassDefFoundError: org/apache/lucene/util/Version] with root cause java.lang.ClassNotFoundException: org.apache.lucene.util.Version
I was using jersey1 before and my web.xml was like this
<servlet>
<servlet-name>Restful App</servlet-name>
<servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Restful App</servlet-name>
<url-pattern>/rest/*</url-pattern>
</servlet-mapping>
Now I have upgraded to jersey2 and changed web.xml to
<servlet>
<servlet-name>javax.ws.rs.core.Application</servlet-name>
</servlet>
<servlet-mapping>
<servlet-name>javax.ws.rs.core.Application</servlet-name>
<url-pattern>/rest/*</url-pattern>
</servlet-mapping>
来源:https://stackoverflow.com/questions/53002022/org-apache-lucene-version-classnotfoundexception-during-elasticsearch