第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

關(guān)于maven tomcat啟動(dòng)錯(cuò)誤

關(guān)于maven tomcat啟動(dòng)錯(cuò)誤

動(dòng)漫人物 2019-02-20 10:47:06
maven(命令為 clean tomcat7:run)啟動(dòng)tomcat提示錯(cuò)誤:org.springframework.web.SpringServletContainerInitializer cannot be cast to javax.servlet.ServletContainerInitializer 自己認(rèn)為是版本沖突問題,但是不知道怎么解決。查了下,有人說是pom.xml中servlet jar包部分的<scope/>應(yīng)該設(shè)為provided,但自己確實(shí)是這么配置的。下面是pom.xml部分內(nèi)容: <dependency> <groupId>javax.servlet</groupId> <artifactId>servlet-api</artifactId> <scope>provided</scope> </dependency> <dependency> <groupId>javax.servlet</groupId> <artifactId>jsp-api</artifactId> <scope>provided</scope> </dependency> 各位有誰遇到過或者對(duì)此有個(gè)人見解,麻煩給予點(diǎn)撥,謝謝! ----------------------Update-------------------------排錯(cuò)能力實(shí)在有限,還是沒能解決問題。貼一下比較完整的信息吧: 這是啟動(dòng)時(shí)的錯(cuò)誤信息: Caused by: java.lang.ClassCastException: org.springframework.web.SpringServletContainerInitializer cannot be cast to javax.servlet.ServletContainerInitializer at org.apache.catalina.startup.ContextConfig.getServletContainerInitializer(ContextConfig.java:1670) at org.apache.catalina.startup.ContextConfig.getServletContainerInitializers(ContextConfig.java:1652) at org.apache.catalina.startup.ContextConfig.processServletContainerInitializers(ContextConfig.java:1562) at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1270) at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:878) at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:376) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119) at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5322) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) ... 6 more 根據(jù)以上信息我猜測(cè)是tomcat本身的api和springframework.web包有沖突(spring版本4.2.4.RELEASE)spring-web含有一個(gè)javax.servlet-api的依賴: <dependency> <groupId>javax.servlet</groupId> <artifactId>javax.servlet-api</artifactId> <version>3.0.1</version> <scope>provided</scope> </dependency> 自己pom.xml配置的servlet是 <dependency> <groupId>javax.servlet</groupId> <artifactId>servlet-api</artifactId> <version>${servlet-api.version}</version> <!--引用2.5--> <scope>provided</scope> </dependency> <dependency> <groupId>javax.servlet</groupId> <artifactId>jsp-api</artifactId> <version>${jsp-api.version}</version> <!--引用2.0--> <scope>provided</scope> </dependency> tomcat使用的是: <groupId>org.apache.tomcat.maven</groupId> <artifactId>tomcat7-maven-plugin</artifactId> <configuration> <path>/</path> <port>8080</port> </configuration> 本來想換tomcat8試試的,但是好像也沒有tomcat8-maven-plugin試過不包含其它jar包也還是如此,所以該如何是好呢?(╥╯^╰╥)
查看完整描述

3 回答

?
MM們

TA貢獻(xiàn)1886條經(jīng)驗(yàn) 獲得超2個(gè)贊

包沖突了,查看下其他引用的jar包中是否有servlet-api,用exclusion標(biāo)簽去掉servlet-api

查看完整回答
反對(duì) 回復(fù) 2019-03-01
?
炎炎設(shè)計(jì)

TA貢獻(xiàn)1808條經(jīng)驗(yàn) 獲得超4個(gè)贊

應(yīng)該是 spring 依賴的 servlet api 包跟 tomcat 7 自帶的 servlet jar 包沖突了吧。
把有依賴到 servlet api 的pom 都排除掉??梢杂?exclusion標(biāo)簽。

查看完整回答
反對(duì) 回復(fù) 2019-03-01
?
慕仙森

TA貢獻(xiàn)1827條經(jīng)驗(yàn) 獲得超8個(gè)贊

指定下 Servlet API 的版本試試看:

<dependency>
    <groupId>javax.servlet</groupId>
    <artifactId>javax.servlet-api</artifactId>
    <version>3.1.0</version>
    <scope>provided</scope>
</dependency>

<dependency>
    <groupId>javax.servlet</groupId>
    <artifactId>jsp-api</artifactId>
    <version>2.0</version>
    <scope>provided</scope>
</dependency>
查看完整回答
反對(duì) 回復(fù) 2019-03-01
  • 3 回答
  • 0 關(guān)注
  • 679 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)