房御塔 2021-09-28 00:22 采纳率: 100%
浏览 66
已结题

idea 2019.1版本,mybatis坐标报错

在mvnrepository官网复制了些使用人数多的jar包坐标,替换掉之前的坐标后,报了这样的错:

img

SLF4J: Failed to load class “org.slf4j.impl.StaticLoggerBinder”
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J:See http://www.s1f4.j.org/codes.html#StaticLoggerBinder for further details
WARNING: An illegal reflective access operation has occurred
        :Illegal reflective access by org.apache.ibatis.reflection. Reflector WARNING: (file:/D:/develop/ studay/apache-maven-3.6.
WARNING: Please consider reporting this to the maintainers of org. apache.ibatis.reflection. Reflector
WARNING: use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Mon Sep 27 23:47:29 CST 2021 WARN: Establishing SSL connection without server's identity verification is not recommende
Brand{id=l,brand name= 三只松鼠”, company_name= 三只松鼠股份有限公司,ordered=5,description=’好吃不上火,status=0
             brand name='华为 Brandlid=2. company_name= 华为技术有限公司”,ordered=100,description=华为致力于把数字世界带入每个人
Brand{id=4. brand name=' 魅族” company_name= 魅族科技有限公司”,ordered=50,description=追求源于热爱”,status=1]
Brand{id=5,brand name='一加, company_name=深圳市万普拉斯科技有限公司,ordered=50,description=不将就(NeverSettle)
Process finished with exit code 0

以下三张图在同一个xml文件中
这是修改后的坐标p1

img

  ?xml version='1.0” encoding=UTF-8”?
 <projectxmlns='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.0http://maven.apache.org/xsd/maven-4.0.0.xsd”
      modelWersion>4.0.0</modelWersion
      (groupId>com.itheima</groupId
      (artifactId>mybatis demol</artifactIdversion>1.0-SNAPSHOT</version
      (dependencies
           <!--mybatis依赖--
一 dependency
               groupId>org.mybatis</groupId
               (artifactId>mybatis</artifactId
               version>3.4.6</version
           </dependency>
          <!--mysal驱动--
           dependency
               (groupId>mysal</groupId
               artifactId>mysal-connector-java</artifactId
               version>5.1.38</version
           </dependency

修改后的坐标p2

img

(!—-junit单元测试-)
dependency
    (groupId> junit</groupId
    artifactId>junit</artifactId
    (version>4.12</version
    (scope>test</scope>
</dependency>
     添加s1f4日志api
(dependency
    (groupId>org.slf4j</groupId
    artifactId>slf4j-api</artifactId
    (version>1.7.25</version>
</dependency>
    添加logback-classic依赖一
<dependency>
    groupId>ch. qos.logback</groupId
    artifactId>logback-classic</artifactId
    version>1.2.3</version
    (scope>test</scope>
</dependency>

修改后的坐标p3

img

               添加logback-core依赖 一
          dependency
               (groupId>ch.qos.logback</groupId
               artifactId>logback-classic</artifactIdversion>1.2.3</version
               (scope>test</scope>
          </dependency>
     </dependencies
</project
               添加logback-core依赖 一
          dependency
               (groupId>ch.qos.logback</groupId
               artifactId>logback-classic</artifactIdversion>1.2.3</version
               (scope>test</scope>
          </dependency>
     </dependencies
</project

这是原先的坐标

img

<dependencies
   <!--mybatis依赖-->
   <dependency>
       <qroupId>org.mybatis</groupId>
       cartifactid>mvbatis</artifactId
       <version3.5.5</version
   </dependency>
   <!--mysq]驱动-->
   dependency
       <groupId>mysgl</groupId>
       <artifactid>mysql-connector-java</artifactId>
       <version>5.1.46</version
   </dependency>
   <!--iunit单元测试-->
   dependency
       <groupid>junit</groupId>
       <artifactId>junit</artifactid
       <version>4.13</version
       Scope>test</scoDe3
   </dependency>
   <!--添加s1f4i日志api- 一
   dependency
       <groupId>org.s1f4j</groupId>
       <artifactid>slf4]-api</artifactId
       <version>1.7.20</version
   </dependency>
   <!--添加logback-classic依赖-->
   Kdependency>
       <qroupId>ch.gos.logback</groupId>
       <artifactid>logback-classic</artifactId>
       <version>1.2.3</versiom
   </dependency>
   <!--添加logback-core依赖--3
   xdependency>
       <groupId>ch.qos.logback</groupId>
       cartifactid>logback-core</artifactId
       <version>1.2.3</version
   </dependency
</dependencies>

请问为什么替换掉坐标后,可以打印结果,但是还是会报错?

  • 写回答

3条回答 默认 最新

  • CSDN专家-sinJack 2021-09-28 00:48
    关注

    你搞错了,这并不是报错,而是正常的日志输出。
    日志中可以看到,前面有显示日志级别为warning,如果是报错就是ERROR级别的了。同时,报错的话,一般程序不会正常运行。
    注意:红色日志不一定是报错,报错也不一定全是红色日志,有一些黑色日志也是报错。

    img

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

问题事件

  • 系统已结题 10月6日
  • 已采纳回答 9月28日
  • 修改了问题 9月28日
  • 创建了问题 9月28日

悬赏问题

  • ¥15 maple软件,用solve求反函数出现rootof,怎么办?
  • ¥50 汇编语言除法溢出问题
  • ¥65 C++实现删除N个数据列表共有的元素
  • ¥15 Visual Studio问题
  • ¥15 state显示变量是字符串形式,但是仍然红色,无法引用,并显示类型不匹配
  • ¥20 求一个html代码,有偿
  • ¥100 关于使用MATLAB中copularnd函数的问题
  • ¥20 在虚拟机的pycharm上
  • ¥15 jupyterthemes 设置完毕后没有效果
  • ¥15 matlab图像高斯低通滤波