Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/spring-mvc/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
用springmvc实现Hibernate搜索_Hibernate_Spring Mvc_Hibernate Search - Fatal编程技术网

用springmvc实现Hibernate搜索

用springmvc实现Hibernate搜索,hibernate,spring-mvc,hibernate-search,Hibernate,Spring Mvc,Hibernate Search,我正在尝试将Hibernate搜索与现有的Spring MVC应用程序集成,在该应用程序中,我使用Hibernate ORM与数据库通信 当我在pom.xml中添加Hibernate搜索依赖项时,它抛出以下错误 [com/poc/configuration/HibernateConfiguration.class]: Invocation of init method failed; nested exception is java.lang.NoClass

我正在尝试将Hibernate搜索与现有的Spring MVC应用程序集成,在该应用程序中,我使用Hibernate ORM与数据库通信

当我在pom.xml中添加Hibernate搜索依赖项时,它抛出以下错误

    [com/poc/configuration/HibernateConfiguration.class]: 
    Invocation of init method failed; nested exception is      
    java.lang.NoClassDefFoundError: org/hibernate/service/spi/BasicServiceInitiator.
这是我的pom.xml文件

    <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.wex.poc</groupId>
<artifactId>spring-security</artifactId>
<packaging>war</packaging>
<version>0.0.1-SNAPSHOT</version>
<name>spring-security Maven Webapp</name>
<url>http://maven.apache.org</url>

<properties>
    <springframework.version>4.2.4.RELEASE</springframework.version>
    <springsecurity.version>4.0.3.RELEASE</springsecurity.version>
    <hibernate.version>4.3.11.Final</hibernate.version>
    <hibernate.search.version>4.4.0.Final</hibernate.search.version>
    <jstl.version>1.2</jstl.version>
</properties>
<dependencies>

    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-search-engine</artifactId>
        <version>${hibernate.search.version}</version>
    </dependency>
    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-search-orm</artifactId>
        <version>{hibernate.search.version}</version>
    </dependency>
    <dependency>
        <groupId>com.fasterxml.jackson.core</groupId>
        <artifactId>jackson-databind</artifactId>
        <version>2.5.0</version>
    </dependency>
    <dependency>
        <groupId>org.postgresql</groupId>
        <artifactId>postgresql</artifactId>
        <version>9.3-1100-jdbc41</version>
    </dependency>
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>3.8.1</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>javax.servlet-api</artifactId>
        <version>3.1.0</version>
        <scope>provided</scope>
    </dependency>
    <!-- Spring -->
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-core</artifactId>
        <version>${springframework.version}</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-web</artifactId>
        <version>${springframework.version}</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-webmvc</artifactId>
        <version>${springframework.version}</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-tx</artifactId>
        <version>${springframework.version}</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-orm</artifactId>
        <version>${springframework.version}</version>
    </dependency>


    <!-- Spring Security -->
    <dependency>
        <groupId>org.springframework.security</groupId>
        <artifactId>spring-security-web</artifactId>
        <version>${springsecurity.version}</version>
    </dependency>
    <dependency>
        <groupId>org.springframework.security</groupId>
        <artifactId>spring-security-config</artifactId>
        <version>${springsecurity.version}</version>
    </dependency>

    <dependency>
        <groupId>org.springframework.security</groupId>
        <artifactId>spring-security-taglibs</artifactId>
        <version>${springsecurity.version}</version>
    </dependency>


    <!-- Hibernate -->
    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-core</artifactId>
        <version>${hibernate.version}</version>
    </dependency>

    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>javax.servlet-api</artifactId>
        <version>3.1.0</version>
    </dependency>
    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>jstl</artifactId>
        <version>${jstl.version}</version>
    </dependency>

</dependencies>
<build>
    <finalName>spring-security</finalName>
</build>

4.0.0
com.wex.poc
春季安全
战争
0.0.1-快照
spring security Maven Webapp
http://maven.apache.org
4.2.4.1发布
4.0.3.1发布
4.3.11.4最终版本
4.4.0.1最终版本
1.2
org.hibernate
hibernate搜索引擎
${hibernate.search.version}
org.hibernate
休眠搜索orm
{hibernate.search.version}
com.fasterxml.jackson.core
杰克逊数据绑定
2.5.0
org.postgresql
postgresql
9.3-1100-jdbc41
朱尼特
朱尼特
3.8.1
测试
javax.servlet
javax.servlet-api
3.1.0
假如
org.springframework
弹簧芯
${springframework.version}
org.springframework
弹簧网
${springframework.version}
org.springframework
SpringWebMVC
${springframework.version}
org.springframework
德克萨斯州春季
${springframework.version}
org.springframework
春季甲虫
${springframework.version}
org.springframework.security
spring安全网
${springsecurity.version}
org.springframework.security
spring安全配置
${springsecurity.version}
org.springframework.security
spring安全标记库
${springsecurity.version}
org.hibernate
冬眠核心
${hibernate.version}
javax.servlet
javax.servlet-api
3.1.0
javax.servlet
jstl
${jstl.version}
春季安全

我知道这是因为hibernate和hibernate搜索之间存在版本冲突

但我无法找出正确的组合


如果有人对此有所了解,请告诉我。

这是现有的Hibernate搜索。您可以在评论中找到可能的解决方案。

Hibernate
搜索导致了Hibernate Core 4.3.0出现此问题。
Hibernate
解决了大多数兼容性问题,如果您想使用Hibernate ORM 4.3.x版,支持它的Hibernate Search的最后一个稳定版本是Hibernate Search版本5.3.0.Final

您不能随意混合依赖项的任何组合:我们在自述文件、下载页面、上以及参考文档中记录兼容范围


如果有疑问,请检查。

请共享问题中编辑的pom.xml文件。请现在检查一下。不,不是。我们从未打算让这个更老的Hibernate搜索版本与never Hibernate ORM兼容:我们清楚地记录了哪些版本是兼容的。请看我的答案。Hibernate搜索不会引起任何问题。人们需要使用正确的版本+1始终检查github项目!