返回顶部

javax.servlet.ServletContext.getVirtualServerName()Ljava/lang/String; springCloud项目启动报错

复制代码
2023-02-21 11:44:13.924 ERROR 27256 --- [ main] o.s.b.d.LoggingFailureAnalysisReporter :

***************************
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:1318)

The following method did not exist:

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

The calling method's class, org.apache.catalina.authenticator.AuthenticatorBase, was loaded from the following location:

jar:file:/E:/SoftWareInstall/repository/org/apache/tomcat/embed/tomcat-embed-core/9.0.56/tomcat-embed-core-9.0.56.jar!/org/apache/catalina/authenticator/AuthenticatorBase.class
复制代码

 

 

 

 

开发springboot项目启动时出现了下面的错误一直没有找到原因:后来发现是 servetl包冲突,有servert-api2.4, 有javax.servlet-api.3.1而且有多份,我一个一个的去除依赖关系,最后剩下一份javax.servlet-api.3.1时正常。

 

 

下面是排除配置:

复制代码
 <dependency>
            <groupId>com.atguigu.gulimall</groupId>
            <artifactId>gulimall-common</artifactId>
            <version>0.0.1-SNAPSHOT</version>
            <exclusions>
                <exclusion>
                    <groupId>com.baomidou</groupId>
                    <artifactId>mybatis-plus-boot-starter</artifactId>
                </exclusion>
                <!--这里把公共模块中引入的servlet-api排除掉,因为下面的web中是有其中的一些依赖的,导致依赖重复冲突,所以将整个exclusion排除掉-->

                    <exclusion>
                        <artifactId>servlet-api</artifactId>
                        <groupId>javax.servlet</groupId>
                    </exclusion>

            </exclusions>
        </dependency>
复制代码
posted @   fen斗  阅读(318)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· winform 绘制太阳,地球,月球 运作规律
· AI与.NET技术实操系列(五):向量存储与相似性搜索在 .NET 中的实现
· 超详细:普通电脑也行Windows部署deepseek R1训练数据并当服务器共享给他人
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
· 上周热点回顾(3.3-3.9)
点击右上角即可分享
微信分享提示