Hibernate Search无法在Spring Boot中运行

时间:2016-05-11 18:16:11

标签: spring-boot hibernate-search

我正在使用Spring Boot,我正在尝试使用Hibernate Search。我遵循了这个tutorial,但我得到了例外:

  

引起:java.lang.NoClassDefFoundError:无法初始化类   org.hibernate.search.cfg.Environment

application.properties

spring.jpa.properties.hibernate.search.default.directory_provider=filesystem
spring.jpa.properties.hibernate.search.default.indexBase=/home

的pom.xml

<dependency>
       <groupId>org.hibernate</groupId>
       <artifactId>hibernate-search-orm</artifactId>
       <version>5.5.3.Final</version>
</dependency>

1 个答案:

答案 0 :(得分:0)

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>1.3.5.RELEASE</version>
</parent>

<dependencies>
    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-search-orm</artifactId>
        <version>4.5.1.Final</version>
    </dependency>

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-data-jpa</artifactId>
    </dependency>
</dependencies>

这可以解决您的问题,因为它在我的春季启动应用程序中运行良好。祝你好运!