问答详情
源自:3-3 datasource和sessionfactorybean的配置

为什么我的MyBatis这个注解报错?

我这个MapperScan注解为什么会报错?我的包有问题还是什么问题?https://img.mukewang.com/5bcf1d820001b86e11720889.jpg

提问者:qq_冬瓜汤_sGLNPZ 2018-10-23 21:09

个回答

  • 慕标9629519
    2018-12-03 10:13:34

    我的<mybatis:scan />这个节点在xml文件中报错,我应该如何解决,求大神帮帮忙

  • 慕虎7020787
    2018-12-01 20:27:36

    import org.mybatis.spring.annotation.MapperScan;
    <dependency>
        <groupId>org.mybatis.spring.boot</groupId>
        <artifactId>mybatis-spring-boot-starter</artifactId>
        <version>1.3.2</version>
    </dependency>


  • 慕侠8807655
    2018-11-27 23:34:25

    pom添加以下两个依赖
     <dependency>
       <groupId>org.mybatis</groupId>
        <artifactId>mybatis</artifactId>
      <version>3.2.8</version>
     </dependency>
    <dependency>
         <groupId>org.mybatis</groupId>
         <artifactId>mybatis-spring</artifactId>
      <version>1.2.2</version>
     </dependency>


  • 慕侠8807655
    2018-11-27 23:33:40

          <!-- mybatis -->22         <dependency>23             <groupId>org.mybatis</groupId>24             <artifactId>mybatis</artifactId>25             <version>3.2.8</version>26         </dependency>27         <dependency>28             <groupId>org.mybatis</groupId>29             <artifactId>mybatis-spring</artifactId>30             <version>1.2.2</version>31          </dependency>


  • 树在摇摆
    2018-10-24 21:59:39

    你可能没有导入吧 

    import org.mybatis.spring.annotation.MapperScan;