springboot整合了log4j2,启动报如下错误:

SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/D:/apache-maven-3.5.2/repo/ch/qos/logback/logback-classic/1.2.3/logback-classic-1.2.3.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/D:/apache-maven-3.5.2/repo/org/apache/logging/log4j/log4j-slf4j-impl/2.12.1/log4j-slf4j-impl-2.12.1.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [ch.qos.logback.classic.util.ContextSelectorStaticBinder]
Logging system failed to initialize using configuration from 'classpath:log4j2.yml'
java.lang.IllegalStateException: Could not initialize Logback logging from classpath:log4j2.ymlat org.springframework.boot.logging.logback.LogbackLoggingSystem.loadConfiguration(LogbackLoggingSystem.java:158)at org.springframework.boot.logging.AbstractLoggingSystem.initializeWithSpecificConfig(AbstractLoggingSystem.java:66)at org.springframework.boot.logging.AbstractLoggingSystem.initialize(AbstractLoggingSystem.java:57)at org.springframework.boot.logging.logback.LogbackLoggingSystem.initialize(LogbackLoggingSystem.java:118)at org.springframework.boot.context.logging.LoggingApplicationListener.initializeSystem(LoggingApplicationListener.java:318)at org.springframework.boot.context.logging.LoggingApplicationListener.initialize(LoggingApplicationListener.java:288)at org.springframework.boot.context.logging.LoggingApplicationListener.onApplicationEnvironmentPreparedEvent(LoggingApplicationListener.java:246)at org.springframework.boot.context.logging.LoggingApplicationListener.onApplicationEvent(LoggingApplicationListener.java:223)at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172)at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165)at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139)at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:127)at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:76)at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:53)at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:345)at org.springframework.boot.SpringApplication.run(SpringApplication.java:308)at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226)at org.springframework.boot.SpringApplication.run(SpringApplication.java:1215)at com.libaolu.zerg.SnackVendorApplication.main(SnackVendorApplication.java:14)
Caused by: ch.qos.logback.core.LogbackException: Unexpected filename extension of file [file:/D:/Workspace4Exercise/applet/snack-vendor/target/classes/log4j2.yml]. Should be either .groovy or .xmlat ch.qos.logback.classic.util.ContextInitializer.configureByResource(ContextInitializer.java:77)at org.springframework.boot.logging.logback.LogbackLoggingSystem.configureByResourceUrl(LogbackLoggingSystem.java:181)at org.springframework.boot.logging.logback.LogbackLoggingSystem.loadConfiguration(LogbackLoggingSystem.java:155)... 18 more

是因为导入的依赖中默认依赖于logging,解决办法在导入的依赖中将logging依赖去掉,如下例:

<dependency><groupId>com.github.pagehelper</groupId><artifactId>pagehelper-spring-boot-starter</artifactId><version>1.2.5</version><exclusions><exclusion><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-logging</artifactId></exclusion></exclusions>
</dependency>

springboot 启动报错 Unexpected filename extension of file相关推荐

  1. springboot整合log4j2报错Unexpected filename extension of file[file__E__classes_log4j2.yml].Should be .xm

    问题描述 今天通过springboot整合log4j2,坐标如下: <!-- log4j2 日志 --><dependency><groupId>org.sprin ...

  2. springboot启动报错:Unregistering JMX-exposed beans on shutdown

    环境 1,maven 3.5.0 2,eclipse 4.7.1 3,spring boot 1.5.9.RELEASE springboot启动报错 按照spring 用户手册创建新的spring ...

  3. SpringBoot启动报错:Parameter 0 of method hmset in com.qcby.rbac.util.RedisUtils required a bean of type

    SpringBoot启动报错,报错信息如下: 报错是由于A类中定义了含参数的构造函数,Spring自动构造和注入时未为该Bean传入参数,引起报错. 查了很多资料,最后发现,我是因为注释的时候没有把@ ...

  4. 启动Spring项目报错,Springboot启动报错 Disconnected from the target VM 解决过程

    启动Spring项目报错,Springboot启动报错 Disconnected from the target VM 解决过程 大概率是缺少了一下依赖 <dependency><g ...

  5. IDEA springboot启动报错java.lang.UnsatisfiedLinkError: no tcnative-1 in java.library.path

    IDEA springboot启动报错: java.lang.UnsatisfiedLinkError: no tcnative-1 in java.library.path: [D:\Java\bi ...

  6. SpringBoot启动报错Could not resolve placeholder ‘XXX.XXX‘ in value

    SpringBoot启动项目时报错: Exception encountered during context initialization - cancelling refresh attempt: ...

  7. springboot启动报错`CommandLineWrapper` is ill-suited for launching apps on Java 9+.

    项目从jdk8升级到jdk11后springboot启动报错,查询多方资料未果 报错信息: `CommandLineWrapper` is ill-suited for launching apps ...

  8. SpringBoot启动报错:org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean

    SpringBoot启动报错:org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean ...

  9. springboot启动报错Logbook

    springboot启动报错 APPLICATION FAILED TO START Description: Field logbookHttpRequestInterceptor in com.j ...

最新文章

  1. ICLR2018 | 深度学习顶会见闻,干货资源都在这里(附源码、论文链接)
  2. mysql游标循环的使用
  3. openssl 签发sm2证书_首个NSA公开披露的软件系统漏洞——CVE20200601数字证书验证漏洞分析与实验...
  4. HTML+CSS+JS实现 ❤️基于Javascript简单计算器特效❤️
  5. Docker的今生前世,关于Docker的一些见解
  6. procise 时钟的坑
  7. SpringBoot指南(八)——SpringBoot整合Redis
  8. 吐血整理!顶级程序员的百宝箱来咯!| 原力计划
  9. js中两种定时器,setTimeout和setInterval的区别
  10. 免费中文Python电子书
  11. node2vec python_图上的机器学习系列-聊聊Node2vec
  12. qq游戏不显示登陆服务器,QQ游戏怎么登陆? qq游戏不能登录怎么办?
  13. 如何免费下载卫星影像图
  14. 京东背调一星期,范围广到可怕。网友:这特么比入党还难?
  15. 如何更有效的进行面试
  16. 微信小程序与webview H5交互(内嵌H5跳转原生页面)
  17. Word制作毕业论文技巧实例--转载
  18. 2022年上海市安全员C证最新解析及上海市安全员C证考试技巧
  19. 高清壁纸wallhaven.cc下载图片
  20. 前端对接身份证阅读器/标签打印机/扫码枪记录

热门文章

  1. Aspose.Words 删除批注
  2. 每个计算机主机只有一个硬盘吗,电脑多加一个硬盘需要重装系统吗? 电脑如何新增加一块硬盘...
  3. npm 安装出现 UNMET DEPENDENCY 的解决方案
  4. 永远的友谊_友谊的传递属性-温馨介绍的重要性
  5. 四川省工程技术研究中心申报解读(条件认定流程各市奖励政策)
  6. 新闻文化建设杂志新闻文化建设杂志社新闻文化建设编辑部2022年第14期目录
  7. android获取GPU信息;android获取GPU渲染器、供应商、版本和扩展名等信息
  8. linux控制NVme硬盘点灯,一种实现多NVMe硬盘背板点灯的设计方法与流程
  9. 纸壳CMS体验升级,快速创建页面,直接在页面中修改内容
  10. 关于使用QML的MediaPlayer实现视频和音频的播放时遇到的一些坑