纯净、安全、绿色的下载网站

首页|软件分类|下载排行|最新软件|IT学院

当前位置:首页IT学院IT技术

SpringBoot接口路径重复启动服务器失败 SpringBoot接口路径重复,启动服务器失败的解决

storyteller_qzx   2021-11-19 我要评论
想了解SpringBoot接口路径重复,启动服务器失败的解决的相关内容吗,storyteller_qzx在本文为您仔细讲解SpringBoot接口路径重复启动服务器失败的相关知识和一些Code实例,欢迎阅读和指正,我们先划重点:SpringBoot接口,接口路径重复,启动服务器失败,下面大家一起来学习吧。

SpringBoot接口路径重复,启动服务器失败

问题

WARN [localhost-startStop-1] o.a.c.loader.WebappClassLoaderBase:180- The web application [ROOT] appears to have started a thread named [RxIoScheduler-1 (Evictor)] but has failed to stop it. This is very likely to create a memory leak.

原因

接口路径重复。我在一个controller里面写了两个put请求,且两个put请求都未重新给接口路径,导致路径重复。

解决方法

给一个方法重新给上路径即可。

启动服务器失败报错 spring-boot Failed to start component [StandardServer[-1]]

2017-08-9 13:45:06,131 [ERROR] [main] [org.springframework.boot.SpringApplication.run(SpringApplication.java:339)] Application startup failed
org.springframework.context.ApplicationContextException: Unable to start embedded container; nested exception is org.springframework.boot.context.embedded.EmbeddedServletContainerException: Unable to start embedded Tomcat
    at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.java:132)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:532)
    at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:117)
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:689)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:321)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:969)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:958)
    at com.longdai.notify.schedule.Application.main(Application.java:23)
Caused by: org.springframework.boot.context.embedded.EmbeddedServletContainerException: Unable to start embedded Tomcat
    at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.initialize(TomcatEmbeddedServletContainer.java:98)
    at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.<init>(TomcatEmbeddedServletContainer.java:75)
    at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory.getTomcatEmbeddedServletContainer(TomcatEmbeddedServletContainerFactory.java:377)
    at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory.getEmbeddedServletContainer(TomcatEmbeddedServletContainerFactory.java:155)
    at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.createEmbeddedServletContainer(EmbeddedWebApplicationContext.java:156)
    at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.java:129)
    ... 7 common frames omitted
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardServer[-1]]
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
    at org.apache.catalina.startup.Tomcat.start(Tomcat.java:337)
    at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.initialize(TomcatEmbeddedServletContainer.java:88)
    ... 12 common frames omitted
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardService[Tomcat]]
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
    at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:769)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    ... 14 common frames omitted
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat]]
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
    at org.apache.catalina.core.StandardService.startInternal(StandardService.java:439)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    ... 16 common frames omitted
Caused by: org.apache.catalina.LifecycleException: A child container failed during start
    at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:924)
    at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:262)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    ... 18 common frames omitted

问题

servlet-api的jar包和springboot的启动jar包产生冲突

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

springBoot启动jar包

<dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-data-jpa</artifactId>
    </dependency>

解决办法

把servlet-api的依赖删除,启动正常

以上为个人经验,希望能给大家一个参考,也希望大家多多支持。


相关文章

猜您喜欢

  • Druid register mbean error 聊聊Druid register mbean error的问题

    想了解聊聊Druid register mbean error的问题的相关内容吗,ShadowWalker在本文为您仔细讲解Druid register mbean error的相关知识和一些Code实例,欢迎阅读和指正,我们先划重点:Druid,register,mbean,error,下面大家一起来学习吧。..
  • C语言中数据的存储 详解C语言中数据的存储

    想了解详解C语言中数据的存储的相关内容吗,C宇言在本文为您仔细讲解C语言中数据的存储的相关知识和一些Code实例,欢迎阅读和指正,我们先划重点:C语言数据,C语言数据存储,下面大家一起来学习吧。..

网友评论

Copyright 2020 www.uigame.net 【UI软件站】 版权所有 软件发布

声明:所有软件和文章来自软件开发商或者作者 如有异议 请与本站联系 点此查看联系方式