Hibernate Search 在 Spring 启动时不工作
Hibernate Search not working in Spring Boot
我正在使用 Spring Boot,并且正在尝试使用 Hibernate Search。我遵循了这个 tutorial 但我得到了例外:
Caused by: java.lang.NoClassDefFoundError: Could not initialize class
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>
<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>
这应该可以解决您的问题,因为它在我的 spring 启动应用程序中运行良好。祝你好运!
我正在使用 Spring Boot,并且正在尝试使用 Hibernate Search。我遵循了这个 tutorial 但我得到了例外:
Caused by: java.lang.NoClassDefFoundError: Could not initialize class 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>
<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>
这应该可以解决您的问题,因为它在我的 spring 启动应用程序中运行良好。祝你好运!