springboot引入spring-boot-starter-web时启动 报错-问答-阿里云开发者社区-阿里云

开发者社区> 佚名4918> 正文

springboot引入spring-boot-starter-web时启动 报错

2021-10-18 18:13:03 67 0
java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [NonLoginAuthenticator[StandardEngine[Tomcat].StandardHost[localhost].TomcatEmbeddedContext[]]]

    at java.util.concurrent.FutureTask.report(FutureTask.java:122) [na:1.8.0_191]

    at java.util.concurrent.FutureTask.get(FutureTask.java:192) [na:1.8.0_191]

    at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:914) [tomcat-embed-core-9.0.14.jar:9.0.14]

    at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:831) [tomcat-embed-core-9.0.14.jar:9.0.14]

    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) [tomcat-embed-core-9.0.14.jar:9.0.14]

    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1382) [tomcat-embed-core-9.0.14.jar:9.0.14]

    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1372) [tomcat-embed-core-9.0.14.jar:9.0.14]

    at java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:266) [na:1.8.0_191]

    at java.util.concurrent.FutureTask.run(FutureTask.java) [na:1.8.0_191]

    at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75) [tomcat-embed-core-9.0.14.jar:9.0.14]

    at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134) [na:1.8.0_191]

    at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:907) [tomcat-embed-core-9.0.14.jar:9.0.14]

    at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:262) [tomcat-embed-core-9.0.14.jar:9.0.14]

    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) [tomcat-embed-core-9.0.14.jar:9.0.14]

    at org.apache.catalina.core.StandardService.startInternal(StandardService.java:423) [tomcat-embed-core-9.0.14.jar:9.0.14]

    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) [tomcat-embed-core-9.0.14.jar:9.0.14]

    at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:933) [tomcat-embed-core-9.0.14.jar:9.0.14]

    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) [tomcat-embed-core-9.0.14.jar:9.0.14]

    at org.apache.catalina.startup.Tomcat.start(Tomcat.java:398) [tomcat-embed-core-9.0.14.jar:9.0.14]

    at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.initialize(TomcatWebServer.java:106) [spring-boot-2.1.2.RELEASE.jar:2.1.2.RELEASE]

    at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.<init>(TomcatWebServer.java:86) [spring-boot-2.1.2.RELEASE.jar:2.1.2.RELEASE]

    at org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory.getTomcatWebServer(TomcatServletWebServerFactory.java:415) [spring-boot-2.1.2.RELEASE.jar:2.1.2.RELEASE]

    at org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory.getWebServer(TomcatServletWebServerFactory.java:174) [spring-boot-2 .1.2.RELEASE.jar:2.1.2.RELEASE]

    at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.createWebServer(ServletWebServerApplicationContext.java:181) [spring-boot-2.1.2.RELEASE.jar:2.1.2.RELEASE]

    at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:154) [spring-boot-2.1.2.RELEASE.jar:2.1.2.RELEASE]

    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:540) [spring-context-5.1.4.RELEASE.jar:5.1.4.RELEASE]

    at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:142) [spring-boot-2.1.2.RELEASE.jar:2.1.2.RELEASE]

    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:775) [spring-boot-2.1.2.RELEASE.jar:2.1.2.RELEASE]

    at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397) [spring-boot-2.1.2.RELEASE.jar:2.1.2.RELEASE]

    at org.springframework.boot.SpringApplication.run(SpringApplication.java:316) [spring-boot-2.1.2.RELEASE.jar:2.1.2.RELEASE]

    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1260) [spring-boot-2.1.2.RELEASE.jar:2.1.2.RELEASE]

    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1248) [spring-boot-2.1.2.RELEASE.jar:2.1.2.RELEASE]

    at com.example.demo.DemoApplication.main(DemoApplication.java:10) [classes/:na]

Caused by: org.apache.catalina.LifecycleException: Failed to start component [NonLoginAuthenticator[StandardEngine[Tomcat].StandardHost[localhost].TomcatEmbeddedContext[]]]

    at org.apache.catalina.util.LifecycleBase.handleSubClassException(LifecycleBase.java:441) [tomcat-embed-core-9.0.14.jar:9.0.14]

    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:198) [tomcat-embed-core-9.0.14.jar:9.0.14]

    at org.apache.catalina.core.StandardPipeline.startInternal(StandardPipeline.java:181) ~[tomcat-embed-core-9.0.14.jar:9.0.14]

    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) [tomcat-embed-core-9.0.14.jar:9.0.14]

    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5041) ~[tomcat-embed-core-9.0.14.jar:9.0.14]

    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) [tomcat-embed-core-9.0.14.jar:9.0.14]

    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1382) [tomcat-embed-core-9.0.14.jar:9.0.14]

    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1372) [tomcat-embed-core-9.0.14.jar:9.0.14]

    at java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:266) [na:1.8.0_191]

    at java.util.concurrent.FutureTask.run(FutureTask.java) [na:1.8.0_191]

    at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75) [tomcat-embed-core-9.0.14.jar:9.0.14]

    at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134) [na:1.8.0_191]

    at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:907) [tomcat-embed-core-9.0.14.jar:9.0.14]

    ... 30 common frames omitted

Caused by: java.lang.NoSuchMethodError: javax.servlet.ServletContext.getVirtualServerName()Ljava/lang/String;

    at org.apache.catalina.authenticator.AuthenticatorBase.startInternal(AuthenticatorBase.java:1178) ~[tomcat-embed-core-9.0.14.jar:9.0.14]

    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) [tomcat-embed-core-9.0.14.jar:9.0.14]

    ... 41 common frames omitted

2019-01-21 22:19:30.303 ERROR 30556 --- [           main] org.apache.catalina.core.ContainerBase   : A child container failed during start

java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: A child container failed during start

    at java.util.concurrent.FutureTask.report(FutureTask.java:122) ~[na:1.8.0_191]

    at java.util.concurrent.FutureTask.get(FutureTask.java:192) ~[na:1.8.0_191]

    at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:914) ~[tomcat-embed-core-9.0.14.jar:9.0.14]

    at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:262) [tomcat-embed-core-9.0.14.jar:9.0.14]

    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) [tomcat-embed-core-9.0.14.jar:9.0.14]

    at org.apache.catalina.core.StandardService.startInternal(StandardService.java:423) [tomcat-embed-core-9.0.14.jar:9.0.14]

    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) [tomcat-embed-core-9.0.14.jar:9.0.14]

    at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:933) [tomcat-embed-core-9.0.14.jar:9.0.14]

    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) [tomcat-embed-core-9.0.14.jar:9.0.14]

    at org.apache.catalina.startup.Tomcat.start(Tomcat.java:398) [tomcat-embed-core-9.0.14.jar:9.0.14]

    at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.initialize(TomcatWebServer.java:106) [spring-boot-2.1.2.RELEASE.jar:2.1.2.RELEASE]

    at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.<init>(TomcatWebServer.java:86) [spring-boot-2.1.2.RELEASE.jar:2.1.2.RELEASE]

    at org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory.getTomcatWebServer(TomcatServletWebServerFactory.java:415) [spring-boot-2.1.2.RELEASE.jar:2.1.2.RELEASE]

    at org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory.getWebServer(TomcatServletWebServerFactory.java:174) [spring-boot-2.1.2.RELEASE.jar:2.1.2.RELEASE]

    at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.createWebServer(ServletWebServerApplicationContext.java:181) [spring-boot-2.1.2.RELEASE.jar:2.1.2.RELEASE]

    at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:154) [spring-boot-2.1.2.RELEASE.jar:2.1.2.RELEASE]

    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:540) [spring-context-5.1.4.RELEASE.jar:5.1.4.RELEASE]

    at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:142) [spring-boot-2.1.2.RELEASE.jar:2.1.2.RELEASE]

    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:775) [spring-boot-2.1.2.RELEASE.jar:2.1.2.RELEASE]

    at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397) [spring-boot-2.1.2.RELEASE.jar:2.1.2.RELEASE]

    at org.springframework.boot.SpringApplication.run(SpringApplication.java:316) [spring-boot-2.1.2.RELEASE.jar:2.1.2.RELEASE]

    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1260) [spring-boot-2.1.2.RELEASE.jar:2.1.2.RELEASE]

    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1248) [spring-boot-2.1.2.RELEASE.jar:2.1.2.RELEASE]

    at com.example.demo.DemoApplication.main(DemoApplication.java:10) [classes/:na]

Caused by: org.apache.catalina.LifecycleException: A child container failed during start

    at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:926) ~[tomcat-embed-core-9.0.14.jar:9.0.14]

    at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:831) ~[tomcat-embed-core-9.0.14.jar:9.0.14]

    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) [tomcat-embed-core-9.0.14.jar:9.0.14]

    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1382) ~[tomcat-embed-core-9.0.14.jar:9.0.14]

    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1372) ~[tomcat-embed-core-9.0.14.jar:9.0.14]

    at java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:266) ~[na:1.8.0_191]

    at java.util.concurrent.FutureTask.run(FutureTask.java) ~[na:1.8.0_191]

    at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75) ~[tomcat-embed-core-9.0.14.jar:9.0.14]

    at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134) ~[na:1.8.0_191]

    at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:907) ~[tomcat-embed-core-9.0.14.jar:9.0.14]

    ... 21 common frames omitted

Caused by: java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [NonLoginAuthenticator[StandardEngine[Tomcat].StandardHost[localhost].TomcatEmbeddedContext[]]]

    at java.util.concurrent.FutureTask.report(FutureTask.java:122) ~[na:1.8.0_191]

    at java.util.concurrent.FutureTask.get(FutureTask.java:192) ~[na:1.8.0_191]

    at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:914) ~[tomcat-embed-core-9.0.14.jar:9.0.14]

    ... 30 common frames omitted

Caused by: org.apache.catalina.LifecycleException: Failed to start component [NonLoginAuthenticator[StandardEngine[Tomcat].StandardHost[localhost].TomcatEmbeddedContext[]]]

    at org.apache.catalina.util.LifecycleBase.handleSubClassException(LifecycleBase.java:441) [tomcat-embed-core-9.0.14.jar:9.0.14]

    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:198) [tomcat-embed-core-9.0.14.jar:9.0.14]

    at org.apache.catalina.core.StandardPipeline.startInternal(StandardPipeline.java:181) ~[tomcat-embed-core-9.0.14.jar:9.0.14]

    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) [tomcat-embed-core-9.0.14.jar:9.0.14]

    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5041) ~[tomcat-embed-core-9.0.14.jar:9.0.14]

    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) [tomcat-embed-core-9.0.14.jar:9.0.14]

    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1382) ~[tomcat-embed-core-9.0.14.jar:9.0.14]

    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1372) ~[tomcat-embed-core-9.0.14.jar:9.0.14]

    at java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:266) ~[na:1.8.0_191]

    at java.util.concurrent.FutureTask.run(FutureTask.java) ~[na:1.8.0_191]

    at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75) ~[tomcat-embed-core-9.0.14.jar:9.0.14]

    at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134) ~[na:1.8.0_191]

    at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:907) ~[tomcat-embed-core-9.0.14.jar:9.0.14]

    ... 30 common frames omitted

Caused by: java.lang.NoSuchMethodError: javax.servlet.ServletContext.getVirtualServerName()Ljava/lang/String;

    at org.apache.catalina.authenticator.AuthenticatorBase.startInternal(AuthenticatorBase.java:1178) ~[tomcat-embed-core-9.0.14.jar:9.0.14]

    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) [tomcat-embed-core-9.0.14.jar:9.0.14]

    ... 41 common frames omitted

Disconnected from the target VM, address: '127.0.0.1:57321', transport: 'socket'

2019-01-21 22:19:30.321  INFO 30556 --- [           main] o.apache.catalina.core.StandardService   : Stopping service [Tomcat]

2019-01-21 22:19:30.322  WARN 30556 --- [           main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat

2019-01-21 22:19:30.322  INFO 30556 --- [           main] ConditionEvaluationReportLoggingListener : 

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.

2019-01-21 22:19:30.333 ERROR 30556 --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   : 

***************************

APPLICATION FAILED TO START

***************************

Description:

An attempt was made to call the method javax.servlet.ServletContext.getVirtualServerName()Ljava/lang/String; but it does not exist. Its class, javax.servlet.ServletContext, is available from the following locations:
    jar:file:/C:/Program%20Files%20(x86)/JAVA/JDK/jre/lib/ext/servlet-api.jar!/javax/servlet/ServletContext.class

    jar:file:/C:/Mavn/maven-repository/org/apache/tomcat/embed/tomcat-embed-core/9.0.14/tomcat-embed-core-9.0.14.jar!/javax/servlet/ServletContext.class

It was loaded from the following location:
    file:/C:/Program%20Files%20(x86)/JAVA/JDK/jre/lib/ext/servlet-api.jar

Action:

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

Process finished with exit code 1
取消 提交回答
全部回答(0)
相关问答

40

回答

[@徐雷frank][¥20]什么是JAVA的平台无关性

大河人家 2018-10-29 23:55:20 144240浏览量 回答数 40

162

回答

惊喜翻倍:免费ECS+免费环境配置~!(ECS免费体验6个月活动3月31日结束)

豆妹 2014-10-29 17:52:21 222929浏览量 回答数 162

145

回答

【新手入门】云服务器linux使用手册

fanyue88888 2012-11-26 17:14:18 157033浏览量 回答数 145

8

回答

OceanBase 使用动画(持续更新)

mq4096 2019-02-20 17:16:36 333776浏览量 回答数 8

13

回答

[@饭娱咖啡][¥20]我想知道 Java 关于引用那一块的知识

心意乱 2018-10-31 18:44:12 142117浏览量 回答数 13

110

回答

OSS存储服务-客户端工具

newegg11 2012-05-17 15:37:18 292216浏览量 回答数 110

22

回答

爬虫数据管理【问答合集】

我是管理员 2018-08-10 16:37:41 146738浏览量 回答数 22

18

回答

阿里云开放端口权限

xcxx 2016-07-20 15:03:33 643003浏览量 回答数 18

31

回答

[@倚贤][¥20]刚学完html/css/js的新手学习servlet、jsp需要注意哪些问题?

弗洛伊德6 2018-10-27 21:52:43 145578浏览量 回答数 31

249

回答

阿里云LNAMP(Linux + Nginx + Apache + MySQL + PHP)环境一键安装脚本

云代维 2014-02-14 15:26:06 302551浏览量 回答数 249
+关注
0
文章
85
问答
问答排行榜
最热
最新
推荐问答
相关电子书
更多
文娱运维技术
立即下载
《SaaS模式云原生数据仓库应用场景实践》
立即下载
《看见新力量:二》电子书
立即下载