午夜剧场伦理_日本一道高清_国产又黄又硬_91黄色网战_女同久久另类69精品国产_妹妹的朋友在线

您的位置:首頁(yè)技術(shù)文章
文章詳情頁(yè)

java - SpringBoot在Eclipse內(nèi)能夠運(yùn)行,但是部署在Tomcat8上啟動(dòng)時(shí)會(huì)有一個(gè)logback的異常

瀏覽:197日期:2023-11-20 18:46:08

問題描述

新開發(fā)一個(gè)項(xiàng)目,我使用了Springboot作為框架,在項(xiàng)目開發(fā)期間我一直使用Eclipse來進(jìn)行測(cè)試,期間一切正常,在近日準(zhǔn)備部署到本地的Tomcat8 上供客戶端開發(fā)的時(shí)候發(fā)現(xiàn)了這個(gè)問題,具體異常如下:

23-May-2017 14:32:20.119 嚴(yán)重 [localhost-startStop-1] org.apache.catalina.core.ContainerBase.addChildInternal ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/ucwapi]] at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:752) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:728) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:734) at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:952) at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1823) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745)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.apache.logging.slf4j.Log4jLoggerFactory loaded from file:/C:/server/apache-tomcat-8.5.15/webapps/ucwapi/WEB-INF/lib/log4j-slf4j-impl-2.4.1.jar). If you are using WebLogic you will need to add ’org.slf4j’ to prefer-application-packages in WEB-INF/weblogic.xml Object of class [org.apache.logging.slf4j.Log4jLoggerFactory] must be an instance of class ch.qos.logback.classic.LoggerContext at org.springframework.util.Assert.isInstanceOf(Assert.java:346) at org.springframework.boot.logging.logback.LogbackLoggingSystem.getLoggerContext(LogbackLoggingSystem.java:221) at org.springframework.boot.logging.logback.LogbackLoggingSystem.getLogger(LogbackLoggingSystem.java:213) at org.springframework.boot.logging.logback.LogbackLoggingSystem.beforeInitialize(LogbackLoggingSystem.java:98) at org.springframework.boot.logging.LoggingApplicationListener.onApplicationStartedEvent(LoggingApplicationListener.java:215) at org.springframework.boot.logging.LoggingApplicationListener.onApplicationEvent(LoggingApplicationListener.java:197) at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:166) at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:138) at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:121) at org.springframework.boot.context.event.EventPublishingRunListener.publishEvent(EventPublishingRunListener.java:111) at org.springframework.boot.context.event.EventPublishingRunListener.started(EventPublishingRunListener.java:60) at org.springframework.boot.SpringApplicationRunListeners.started(SpringApplicationRunListeners.java:48) at org.springframework.boot.SpringApplication.run(SpringApplication.java:303) at org.springframework.boot.context.web.SpringBootServletInitializer.run(SpringBootServletInitializer.java:149) at org.springframework.boot.context.web.SpringBootServletInitializer.createRootApplicationContext(SpringBootServletInitializer.java:129) at org.springframework.boot.context.web.SpringBootServletInitializer.onStartup(SpringBootServletInitializer.java:85) at org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:169) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5196) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) ... 10 more23-May-2017 14:32:20.120 嚴(yán)重 [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Error deploying web application archive [C:serverapache-tomcat-8.5.15webappsucwapi.war] java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/ucwapi]] at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:756) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:728) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:734) at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:952) at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1823) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745)

Springboot 版本為1.3.5logback版本為1.1.7

問題解答

回答1:

Tomcat7.0 升級(jí)至8.0 問題解決

回答2:

本地打war能運(yùn)行不?

java - SpringBoot在Eclipse內(nèi)能夠運(yùn)行,但是部署在Tomcat8上啟動(dòng)時(shí)會(huì)有一個(gè)logback的異常

回答3:

原因:ClassLoader 的關(guān)系,IDE中的ClassLoader 實(shí)現(xiàn)與 Spring Boot JarLauncher 不同,因此,加載了不同的jar。log4j-slf4j 與logback 均為 slf4j-api的實(shí)現(xiàn),所以沖突了。

解決方法:移除 log4j-slf4j 依賴(通過Maven)

標(biāo)簽: java
主站蜘蛛池模板: 国产乱人伦精品一区二区 | 色444 | 中文字幕在线网 | 国产麻豆91视频 | 成人免费视频观看 | 亚洲一区二区三区中文字幕 | 麻豆av在线免费观看 | 爆操欧美美女 | 麻豆理论片 | 高清一区二区三区视频 | 好吊色青青草 | 国产一区二区观看 | 欧美黄色激情视频 | 国产人成一区二区三区影院 | 中国女人一级一次看片 | 亚洲第一页av| 国产在线二区 | 国产成人精品亚洲线观看 | 日韩中文字幕在线视频 | 国产成人在线网站 | 一区二区播放 | 国产精品日韩欧美大师 | 男女一级裸片 | 中午字幕在线观看 | 国产精品综合 | 欧美黑人狂野猛交老妇 | 亚洲男人第一天堂 | 欧美男人亚洲天堂 | 深夜视频在线免费观看 | 新呦u视频一区二区 | 国产jjizz一区二区三区视频 | 久久精品在线播放 | 黄色av免费观看 | 欧美日韩一区二区三区不卡 | 在线免费观看不卡av | 天堂精品视频 | 伊人网在线 | 91麻豆精品 | 一级片一级片一级片一级片 | 国产午夜三级 | 国产91精品在线观看 |