springboot項目啟動異常Correct the classpath of your application so that it contains a single, compatible version of javax.servlet.ServletContext


 

啟動springboot,報錯

***************************
APPLICATION FAILED TO START
***************************

Description:

An attempt was made to call a method that does not exist. The attempt was made from the following location:

org.apache.catalina.authenticator.AuthenticatorBase.startInternal(AuthenticatorBase.java:1321)

The following method did not exist:

javax.servlet.ServletContext.getVirtualServerName()Ljava/lang/String;

The method's class, javax.servlet.ServletContext, is available from the following locations:

jar:file:/cloud-0.0.1-SNAPSHOT.jar!/BOOT-INF/lib/servlet-api-2.5.jar!/javax/servlet/ServletContext.class
jar:file:/cloud-0.0.1-SNAPSHOT.jar!/BOOT-INF/lib/tomcat-embed-core-9.0.37.jar!/javax/servlet/ServletContext.class

The class hierarchy was loaded from the following locations:

javax.servlet.ServletContext: jar:file:/cloud-0.0.1-SNAPSHOT.jar!/BOOT-INF/lib/servlet-api-2.5.jar!/


Action:

Correct the classpath of your application so that it contains a single, compatible version of javax.servlet.ServletContext

 

 

解決:

 

去pom文件夾找重復的包 刪掉一個重復的就行了 報錯中已經把重復的包指出來了

https://blog.csdn.net/m0_37783096/article/details/90767755

https://blog.csdn.net/baidu_41678737/article/details/89455858

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM