在Spring Boot中将Apache Mahout与ElasticSearch集成



我有一个集成了ElasticSearch的Spring Boot应用程序。 当我尝试将 Apache Mahout 添加为 maven 依赖项时,应用程序不再运行并显示此错误:

Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: org/apache/lucene/util/Accountable

如果我删除 mahout 依赖项,应用程序正在运行。 绒球.xml:

<dependencies>
<dependency>
<groupId>org.apache.mahout</groupId>
<artifactId>mahout-core</artifactId>
<version>0.9</version>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-elasticsearch</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>

</dependencies>

依赖关系由 maven 解决,项目编译没有错误,但是当我启动它时,服务器停止了。 知道吗? 谢谢

为了使用最新版本的Elasticsearc v6.x和Spring-boot,你必须关注矩阵版本。 因为当我尝试将 Elasticsearch v6.2.2 作为依赖项集成到我的 spring-boot v1.5.X 中时,我遇到了几个错误。 因此,spring-boot v2.x 是与 ES v6.x 兼容的 因此,以下链接将帮助您了解项目版本之间的矩阵: https://www.elastic.co/support/matrix#matrix_compatibility 完成此操作后,使用最新版本的 Apache Mahout。

最新更新