• 【Exception】LoggerFactory is not a Logback LoggerContext but Logback is on the classpath. Either remove Logback or the competing implementation (class org.slf4j.impl.SimpleLoggerFactory


    1.当我对springboot项目进行部署到tomcat的操作时,报了以下异常

    Caused by: java.lang.IllegalArgumentException: LoggerFactory is not a Logback LoggerContext but Logback is on the classpath. Either remove Logback or the competing implementation (class org.slf4j.impl.SimpleLoggerFactory loaded from file:/Users/design/work/tomcat-9.0.19/webapps/OA/WEB-INF/lib/slf4j-simple-1.7.26.jar). If you are using WebLogic you will need to add 'org.slf4j' to prefer-application-packages in WEB-INF/weblogic.xml: org.slf4j.impl.SimpleLoggerFactory
    	at org.springframework.util.Assert.instanceCheckFailed(Assert.java:655)
    	at org.springframework.util.Assert.isInstanceOf(Assert.java:555)
    	at org.springframework.boot.logging.logback.LogbackLoggingSystem.getLoggerContext(LogbackLoggingSystem.java:286)
    	at org.springframework.boot.logging.logback.LogbackLoggingSystem.beforeInitialize(LogbackLoggingSystem.java:102)
    	at org.springframework.boot.context.logging.LoggingApplicationListener.onApplicationStartingEvent(LoggingApplicationListener.java:219)
    	at org.springframework.boot.context.logging.LoggingApplicationListener.onApplicationEvent(LoggingApplicationListener.java:198)
    	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.starting(EventPublishingRunListener.java:69)
    	at org.springframework.boot.SpringApplicationRunListeners.starting(SpringApplicationRunListeners.java:48)
    	at org.springframework.boot.SpringApplication.run(SpringApplication.java:302)
    	at org.springframework.boot.web.servlet.support.SpringBootServletInitializer.run(SpringBootServletInitializer.java:157)
    	at org.springframework.boot.web.servlet.support.SpringBootServletInitializer.createRootApplicationContext(SpringBootServletInitializer.java:137)
    	at org.springframework.boot.web.servlet.support.SpringBootServletInitializer.onStartup(SpringBootServletInitializer.java:91)
    	at org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:171)
    	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5139)
    	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
    	... 38 more
    

      

    分析可知是依赖问题,通过idea找到slf4j-simple,并去掉依赖

     <dependency>
                <groupId>org.solar</groupId>
                <artifactId>solar-core</artifactId>
                <version>1.1</version>
                <exclusions>
                    <exclusion>
                        <artifactId>slf4j-simple</artifactId>
                        <groupId>org.slf4j</groupId>
                    </exclusion>
                </exclusions>
            </dependency>
    

      

            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter</artifactId>
                <exclusions>
                    <exclusion>
                        <artifactId>log4j-to-slf4j</artifactId>
                        <groupId>org.apache.logging.log4j</groupId>
                    </exclusion>
                </exclusions>
            </dependency>
    

      

    最终只剩:

    成功解救 

  • 相关阅读:
    jpeg 文档格式
    gif 文件格式
    firefox前世今生
    png 文档格式
    字符'\xe5\x8c\x97\xe4\xba\xac\xe6\x96\xb0\xe5\x8d\x8e\xe7\x94\xb5\xe8\x84\x91\xe5\xad\xa6\xe6\xa0\xa1' 转为汉字
    SQL server 报错:
    encode 与 decode
    Octave 作图 无响应
    qmake建工程
    urlparse (scheme、netloc、path等)
  • 原文地址:https://www.cnblogs.com/kingdelee/p/10811575.html
Copyright © 2020-2023  润新知