我正在为Elasticsearch编写一个自定义插件,这个插件依赖于Jackson库。当我在Elasticsearch上安装插件时,我得到了以下错误:
线程“主”java.lang.IllegalStateException中的异常:无法加载插件AdapterPlugin,原因是jar地狱: java.lang.IllegalStateException: jar地狱!类: C:\elasticsearch-6.2.4\lib\jackson-core-2.8.10.jar jar2: C:\elasticsearch-6.2.4\plugins.installing-4501343069579282727\jackson-core-2.8.10.jar at org.elasticsearch.bootstrap.JarHell.checkClass(JarHell.java:275) at org.elasticsearch.bootstrap.JarHell.checkJarHell(JarHell.java:192) at org.elasticsearch.plugins.PluginsService.checkBundleJarHell(PluginsService.java:473) .再来12个
我如何解决这个问题?正如您所见,我试图将我的Jackson版本从最新版本更改为2.8.10(弹性6.2.4使用它),但这并没有帮助。
我使用的是maven,下面是我用于cuatom插件的pox.xml文件:
<dependencies>
<dependency>
<groupId>org.elasticsearch</groupId>
<artifactId>elasticsearch</artifactId>
<version>6.2.4</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.8.10</version>
</dependency>
</dependencies>发布于 2018-05-27 12:02:23
如何包括类路径上的依赖项?梅文?格拉德尔?需要更多的信息。如果使用Maven,则可以在添加Elasticsearch时使用排除,并自己包含jackson库:
<project>
...
<dependencies>
<dependency>
<groupId>org.elasticsearch</groupId>
<artifactId>elasticsearch</artifactId>
<version>6.2.4</version>
<scope>compile</scope>
<exclusions>
<exclusion> <!-- declare the exclusion here -->
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
</project>发布于 2022-06-17 11:43:50
https://stackoverflow.com/questions/50551865
复制相似问题