• 在整合spring和mongodb中,提示at org.springframework.data.mapping.model.BasicPersistentEntity.findAnnotation(


    遇到这种坑,找了好多资料。基本是都是因为springdata的jar包和spring的版本不兼容导致,除了这个错误之外,还有会比较多其他错误,也是版本不兼容导致的。

    at org.springframework.data.mapping.model.BasicPersistentEntity.findAnnotation

    在这里,我写一个我用的版本号:

    我使用的是maven:

    <?xml version="1.0" encoding="UTF-8"?>
    <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/xsd/maven-4.0.0.xsd">
        <modelVersion>4.0.0</modelVersion>
    
        <groupId>S_M3</groupId>
        <artifactId>S_M3</artifactId>
        <version>1.0-SNAPSHOT</version>
    
    
        <properties>
            <spring.version>4.3.7.RELEASE</spring.version>
            <jstl.version>1.2</jstl.version>
            <servlet-api.version>2.5</servlet-api.version>
            <jsp-api.version>2.0</jsp-api.version>
        </properties>
    
        <dependencies>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-core</artifactId>
                <version>${spring.version}</version>
            </dependency>
    
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-context</artifactId>
                <version>${spring.version}</version>
            </dependency>
    
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-jdbc</artifactId>
                <version>${spring.version}</version>
            </dependency>
    
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-web</artifactId>
                <version>${spring.version}</version>
            </dependency>
    
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-webmvc</artifactId>
                <version>${spring.version}</version>
            </dependency>
    
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-test</artifactId>
                <version>${spring.version}</version>
                <!--<scope>test</scope>-->
            </dependency>
    
            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>4.12</version>
                <!--<scope>test</scope>-->
            </dependency>
    
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-log4j12</artifactId>
                <version>1.7.2</version>
            </dependency>
            <dependency>
                <groupId>commons-dbcp</groupId>
                <artifactId>commons-dbcp</artifactId>
                <version>1.4</version>
            </dependency>
    
            <dependency>
                <groupId>jstl</groupId>
                <artifactId>jstl</artifactId>
                <version>${jstl.version}</version>
            </dependency>
            <dependency>
                <groupId>javax.servlet</groupId>
                <artifactId>servlet-api</artifactId>
                <version>${servlet-api.version}</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>javax.servlet</groupId>
                <artifactId>jsp-api</artifactId>
                <version>${jsp-api.version}</version>
                <scope>provided</scope>
            </dependency>
    
            <!--mongodb-->
    
            <dependency>
                <groupId>org.mongodb</groupId>
                <artifactId>mongo-java-driver</artifactId>
                <version>2.12.4</version>
            </dependency>
    
            <!--<dependency>-->
                <!--<groupId>org.springframework.data</groupId>-->
                <!--<artifactId>spring-data-commons</artifactId>-->
                <!--<version>1.13.0.RELEASE</version>-->
            <!--</dependency>-->
    
            <dependency>
                <groupId>org.springframework.data</groupId>
                <artifactId>spring-data-mongodb</artifactId>
                <version>1.9.5.RELEASE</version>
            </dependency>
    
    
    
            <!--jsp 相关-->
            <dependency>
                <groupId>com.github.jsqlparser</groupId>
                <artifactId>jsqlparser</artifactId>
                <version>0.9.4</version>
            </dependency>
    
            <dependency>
                <groupId>com.github.pagehelper</groupId>
                <artifactId>pagehelper</artifactId>
                <version>4.0.3</version>
            </dependency>
            <!--<dependency>-->
                <!--<groupId>org.junit.jupiter</groupId>-->
                <!--<artifactId>junit-jupiter-api</artifactId>-->
                <!--<version>RELEASE</version>-->
            <!--</dependency>-->
    
        </dependencies>
    
    
    </project>
  • 相关阅读:
    存储过程语法
    ORA-20000:ORU-10027:buffer overflow,limit of 2000 bytes.
    ORACLE 存储过程异常捕获并抛出
    Sqlldr导入txt文件内容到数据库中
    ORA-01589: 要打开数据库则必须使用 RESETLOGS 或 NORESETLOGS 选项
    oracle将一个表中字段的值赋值到另一个表中字段(批量)
    (三)Solr——Solr的基本使用
    (二)Solr——Solr界面介绍
    jrebel 7免费激活(非破解) 和 IntelliJ Idea 2017 免费激活方法
    (一)Solr——简介和安装配置
  • 原文地址:https://www.cnblogs.com/handsomeBoys/p/7659926.html
Copyright © 2020-2023  润新知