org.apache.lucene.Version ClassNotFoundException during elasticsearch

匆匆过客 提交于 2020-01-06 12:25:51

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!