RZ259
2021-09-28 00:22
采纳率: 100%
浏览 51
已结题

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

    已采纳该答案
    评论
    解决 1 无用
    打赏 举报
  • 
    <dependency>
                <groupId>mysql</groupId>
                <artifactId>mysql-connector-java</artifactId>
                <version>5.1.48</version>
            </dependency>
    <dependency>
                <groupId>com.baomidou</groupId>
                <artifactId>mybatis-plus-boot-starter</artifactId>
                <version>3.3.1</version>
            </dependency>
    
    评论
    解决 1 无用
    打赏 举报
  • 酷爱码 2021-09-28 09:00

    你这不是报错呀,我没看到ERROR,红色的不是报错只是日志,你没有设置日志等级才会出来,如果日志等级你设置成ERROR,这些日志都不会出现了

    评论
    解决 1 无用
    打赏 举报

相关推荐 更多相似问题