gpt4 book ai didi

elasticsearch - Hibernate-Search 6和Elasticsearch集成

转载 作者:行者123 更新时间:2023-12-02 23:12:29 29 4
gpt4 key购买 nike

我正在使用Hibernate Search应用程序,并且正在尝试使用版本6(目前处于beta版)。我遵循了https://docs.jboss.org/hibernate/search/6.0/reference/en-US/html_single/#getting-started-configuration中的所有说明和文档

尝试启动我的应用程序后,出现下一个错误:

我看过Google,似乎是我是世界上第一个面临此问题的人。

***************************
APPLICATION FAILED TO START
***************************

Description:

An attempt was made to call a method that does not exist. The attempt was made from the following location:

org.hibernate.search.mapper.orm.mapping.impl.HibernateOrmIndexedTypeContext.<init>(HibernateOrmIndexedTypeContext.java:35)

The following method did not exist:

org.hibernate.metamodel.spi.MetamodelImplementor.entity(Ljava/lang/Class;)Lorg/hibernate/metamodel/model/domain/spi/EntityTypeDescriptor;

It was loaded from the following location:

file:/home/myUser/.m2/repository/org/hibernate/hibernate-core/5.3.11.Final/hibernate-core-5.3.11.Final.jar


Action:

Correct the classpath of your application so that it contains a single, compatible version of org.hibernate.metamodel.spi.MetamodelImplementor


任何解决方案的想法吗?,在我的应用程序中,我正在使用Spring boot和jpa。

最佳答案

here in the documentation所示,Hibernate Search 6.0.0.Beta2需要Hibernate ORM 5.4.7.Final或更高版本。您正在使用Hibernate ORM 5.3.11.Final。

我认为Spring Boot 2.1随ORM 5.3一起提供,所以这可能就是您所使用的。

最好的做法是升级到Hibernate ORM 5.4附带的Spring Boot 2.2.1.RELEASE。

如果不可能,那么您仍然可以继续使用Spring Boot 2.1,并直接在POM中覆盖Hibernate ORM的版本:据我所知,它在Spring Boot 2.1中运行良好。

只需在您的POM中设置此属性:

    <properties>
<!-- Override the version of Hibernate ORM in Spring Boot -->
<hibernate.version>5.4.7.Final</hibernate.version>
</properties>

请注意,从技术上讲,Hibernate ORM 5.4.4.Final之后的任何版本都可以使用,但是坚持使用经过测试的Hibernate Search版本通常更安全。

关于elasticsearch - Hibernate-Search 6和Elasticsearch集成,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58812581/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com