- mongodb - 在 MongoDB mapreduce 中,如何展平值对象?
- javascript - 对象传播与 Object.assign
- html - 输入类型 ="submit"Vs 按钮标签它们可以互换吗?
- sql - 使用 MongoDB 而不是 MS SQL Server 的优缺点
我可以用mvn spring-boot
成功启动spring-boot,documentation提到优雅地退出应用程序点击 ctrl-c
。
Terminate batch job (Y/N)? Y
maven 进程确实终止了,但 Tomcat 仍在运行,我仍然可以访问网页。当我尝试再次启动 spring-boot 时,它无法启动 Tomcat,因为该端口正在使用中。
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v1.1.0.BUILD-SNAPSHOT)
2014-05-02 12:13:57.666 INFO 6568 --- [ main] Example : Starting Example on challenger with PID 6568 (E:\workspace\SpringBoot\target\cla
sses started by steven in E:\workspace\SpringBoot)
2014-05-02 12:13:57.707 INFO 6568 --- [ main] ationConfigEmbeddedWebApplicationContext : Refreshing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWeb
ApplicationContext@11ecab7c: startup date [Fri May 02 12:13:57 EDT 2014]; root of context hierarchy
2014-05-02 12:13:58.097 INFO 6568 --- [ main] o.s.b.f.s.DefaultListableBeanFactory : Overriding bean definition for bean 'beanNameViewResolver': replacing [Root bean
: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=org.springframework.boot.autoconfi
gure.web.ErrorMvcAutoConfiguration$WhitelabelErrorViewConfiguration; factoryMethodName=beanNameViewResolver; initMethodName=null; destroyMethodName=(inferred); defined in class pat
h resource [org/springframework/boot/autoconfigure/web/ErrorMvcAutoConfiguration$WhitelabelErrorViewConfiguration.class]] with [Root bean: class [null]; scope=; abstract=false; laz
yInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=org.springframework.boot.autoconfigure.web.WebMvcAutoConfiguration$WebMvcAuto
ConfigurationAdapter; factoryMethodName=beanNameViewResolver; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [org/springframework/boot/autoconfig
ure/web/WebMvcAutoConfiguration$WebMvcAutoConfigurationAdapter.class]]
2014-05-02 12:13:58.682 INFO 6568 --- [ main] .t.TomcatEmbeddedServletContainerFactory : Server initialized with port: 8080
2014-05-02 12:13:58.892 INFO 6568 --- [ main] o.apache.catalina.core.StandardService : Starting service Tomcat
2014-05-02 12:13:58.892 INFO 6568 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet Engine: Apache Tomcat/7.0.53
2014-05-02 12:13:58.981 INFO 6568 --- [ost-startStop-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2014-05-02 12:13:58.981 INFO 6568 --- [ost-startStop-1] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 1277 ms
2014-05-02 12:13:59.453 INFO 6568 --- [ost-startStop-1] o.s.b.c.e.ServletRegistrationBean : Mapping servlet: 'dispatcherServlet' to [/]
2014-05-02 12:13:59.455 INFO 6568 --- [ost-startStop-1] o.s.b.c.embedded.FilterRegistrationBean : Mapping filter: 'hiddenHttpMethodFilter' to: [/*]
2014-05-02 12:13:59.570 ERROR 6568 --- [ main] o.a.coyote.http11.Http11NioProtocol : Failed to start end point associated with ProtocolHandler ["http-nio-8080"]
java.net.BindException: Address already in use: bind
at sun.nio.ch.Net.bind0(Native Method)
at sun.nio.ch.Net.bind(Net.java:344)
at sun.nio.ch.Net.bind(Net.java:336)
at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:199)
at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
at org.apache.tomcat.util.net.NioEndpoint.bind(NioEndpoint.java:473)
at org.apache.tomcat.util.net.AbstractEndpoint.start(AbstractEndpoint.java:647)
at org.apache.coyote.AbstractProtocol.start(AbstractProtocol.java:449)
at org.apache.catalina.connector.Connector.startInternal(Connector.java:1007)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.StandardService.startInternal(StandardService.java:459)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:731)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.startup.Tomcat.start(Tomcat.java:341)
at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.initialize(TomcatEmbeddedServletContainer.java:79)
at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.<init>(TomcatEmbeddedServletContainer.java:69)
at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory.getTomcatEmbeddedServletContainer(TomcatEmbeddedServletContainerFactory.java:270)
at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory.getEmbeddedServletContainer(TomcatEmbeddedServletContainerFactory.java:145)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.createEmbeddedServletContainer(EmbeddedWebApplicationContext.java:159)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.java:132)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:476)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:120)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:680)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:313)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:941)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:930)
at Example.main(Example.java:16)
2014-05-02 12:13:59.571 ERROR 6568 --- [ main] o.apache.catalina.core.StandardService : Failed to start connector [Connector[org.apache.coyote.http11.Http11NioProtocol-
8080]]
org.apache.catalina.LifecycleException: Failed to start component [Connector[org.apache.coyote.http11.Http11NioProtocol-8080]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
at org.apache.catalina.core.StandardService.startInternal(StandardService.java:459)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:731)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.startup.Tomcat.start(Tomcat.java:341)
at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.initialize(TomcatEmbeddedServletContainer.java:79)
at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.<init>(TomcatEmbeddedServletContainer.java:69)
at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory.getTomcatEmbeddedServletContainer(TomcatEmbeddedServletContainerFactory.java:270)
at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory.getEmbeddedServletContainer(TomcatEmbeddedServletContainerFactory.java:145)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.createEmbeddedServletContainer(EmbeddedWebApplicationContext.java:159)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.java:132)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:476)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:120)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:680)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:313)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:941)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:930)
at Example.main(Example.java:16)
Caused by: org.apache.catalina.LifecycleException: service.getName(): "Tomcat"; Protocol handler start failed
at org.apache.catalina.connector.Connector.startInternal(Connector.java:1014)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 18 common frames omitted
Caused by: java.net.BindException: Address already in use: bind
at sun.nio.ch.Net.bind0(Native Method)
at sun.nio.ch.Net.bind(Net.java:344)
at sun.nio.ch.Net.bind(Net.java:336)
at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:199)
at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
at org.apache.tomcat.util.net.NioEndpoint.bind(NioEndpoint.java:473)
at org.apache.tomcat.util.net.AbstractEndpoint.start(AbstractEndpoint.java:647)
at org.apache.coyote.AbstractProtocol.start(AbstractProtocol.java:449)
at org.apache.catalina.connector.Connector.startInternal(Connector.java:1007)
... 19 common frames omitted
2014-05-02 12:13:59.572 INFO 6568 --- [ main] o.apache.catalina.core.StandardService : Stopping service Tomcat
2014-05-02 12:13:59.580 INFO 6568 --- [ main] .b.l.ClasspathLoggingApplicationListener : Application failed to start with classpath: [file:/E:/workspace/SpringBoot/src/m
ain/resources, file:/E:/workspace/SpringBoot/src/main/resources, file:/E:/workspace/SpringBoot/target/classes/, file:/C:/Users/steven/.m2/repository/org/springframework/boot/spring
-boot-starter-web/1.1.0.BUILD-SNAPSHOT/spring-boot-starter-web-1.1.0.BUILD-SNAPSHOT.jar, file:/C:/Users/steven/.m2/repository/org/springframework/boot/spring-boot-starter/1.1.0.BUI
LD-SNAPSHOT/spring-boot-starter-1.1.0.BUILD-SNAPSHOT.jar, file:/C:/Users/steven/.m2/repository/org/springframework/boot/spring-boot/1.1.0.BUILD-SNAPSHOT/spring-boot-1.1.0.BUILD-SNA
PSHOT.jar, file:/C:/Users/steven/.m2/repository/org/springframework/boot/spring-boot-autoconfigure/1.1.0.BUILD-SNAPSHOT/spring-boot-autoconfigure-1.1.0.BUILD-SNAPSHOT.jar, file:/C:
/Users/steven/.m2/repository/org/springframework/boot/spring-boot-starter-logging/1.1.0.BUILD-SNAPSHOT/spring-boot-starter-logging-1.1.0.BUILD-SNAPSHOT.jar, file:/C:/Users/steven/.
m2/repository/org/slf4j/jcl-over-slf4j/1.7.7/jcl-over-slf4j-1.7.7.jar, file:/C:/Users/steven/.m2/repository/org/slf4j/slf4j-api/1.7.7/slf4j-api-1.7.7.jar, file:/C:/Users/steven/.m2
/repository/org/slf4j/jul-to-slf4j/1.7.7/jul-to-slf4j-1.7.7.jar, file:/C:/Users/steven/.m2/repository/org/slf4j/log4j-over-slf4j/1.7.7/log4j-over-slf4j-1.7.7.jar, file:/C:/Users/st
even/.m2/repository/ch/qos/logback/logback-classic/1.1.2/logback-classic-1.1.2.jar, file:/C:/Users/steven/.m2/repository/ch/qos/logback/logback-core/1.1.2/logback-core-1.1.2.jar, f
ile:/C:/Users/steven/.m2/repository/org/yaml/snakeyaml/1.13/snakeyaml-1.13.jar, file:/C:/Users/steven/.m2/repository/org/springframework/boot/spring-boot-starter-tomcat/1.1.0.BUILD
-SNAPSHOT/spring-boot-starter-tomcat-1.1.0.BUILD-SNAPSHOT.jar, file:/C:/Users/steven/.m2/repository/org/apache/tomcat/embed/tomcat-embed-core/7.0.53/tomcat-embed-core-7.0.53.jar, f
ile:/C:/Users/steven/.m2/repository/org/apache/tomcat/embed/tomcat-embed-el/7.0.53/tomcat-embed-el-7.0.53.jar, file:/C:/Users/steven/.m2/repository/org/apache/tomcat/embed/tomcat-e
mbed-logging-juli/7.0.53/tomcat-embed-logging-juli-7.0.53.jar, file:/C:/Users/steven/.m2/repository/com/fasterxml/jackson/core/jackson-databind/2.3.3/jackson-databind-2.3.3.jar, fi
le:/C:/Users/steven/.m2/repository/com/fasterxml/jackson/core/jackson-annotations/2.3.0/jackson-annotations-2.3.0.jar, file:/C:/Users/steven/.m2/repository/com/fasterxml/jackson/co
re/jackson-core/2.3.3/jackson-core-2.3.3.jar, file:/C:/Users/steven/.m2/repository/org/springframework/spring-web/4.0.3.RELEASE/spring-web-4.0.3.RELEASE.jar, file:/C:/Users/steven/
.m2/repository/org/springframework/spring-aop/4.0.3.RELEASE/spring-aop-4.0.3.RELEASE.jar, file:/C:/Users/steven/.m2/repository/aopalliance/aopalliance/1.0/aopalliance-1.0.jar, file
:/C:/Users/steven/.m2/repository/org/springframework/spring-beans/4.0.3.RELEASE/spring-beans-4.0.3.RELEASE.jar, file:/C:/Users/steven/.m2/repository/org/springframework/spring-cont
ext/4.0.3.RELEASE/spring-context-4.0.3.RELEASE.jar, file:/C:/Users/steven/.m2/repository/org/springframework/spring-core/4.0.3.RELEASE/spring-core-4.0.3.RELEASE.jar, file:/C:/Users
/steven/.m2/repository/org/springframework/spring-webmvc/4.0.3.RELEASE/spring-webmvc-4.0.3.RELEASE.jar, file:/C:/Users/steven/.m2/repository/org/springframework/spring-expression/4
.0.3.RELEASE/spring-expression-4.0.3.RELEASE.jar]
Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; nested exception is org.springframework.boot.context.embedde
d.EmbeddedServletContainerException: Unable to start embedded Tomcat
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.java:135)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:476)
[INFO] ------------------------------------------------------------------------
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:120)
[INFO] BUILD SUCCESS
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:680)
[INFO] ------------------------------------------------------------------------
at org.springframework.boot.SpringApplication.run(SpringApplication.java:313)
[INFO] Total time: 4.653 s
at org.springframework.boot.SpringApplication.run(SpringApplication.java:941)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:930)
at Example.main(Example.java:16)
Caused by: org.springframework.boot.context.embedded.EmbeddedServletContainerException: Unable to start embedded Tomcat
[INFO] Finished at: 2014-05-02T12:13:59-05:00
at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.initialize(TomcatEmbeddedServletContainer.java:106)
[INFO] Final Memory: 16M/232M
[INFO] ------------------------------------------------------------------------
at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.<init>(TomcatEmbeddedServletContainer.java:69)
at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory.getTomcatEmbeddedServletContainer(TomcatEmbeddedServletContainerFactory.java:270)
at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory.getEmbeddedServletContainer(TomcatEmbeddedServletContainerFactory.java:145)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.createEmbeddedServletContainer(EmbeddedWebApplicationContext.java:159)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.java:132)
... 7 more
Caused by: java.lang.IllegalStateException: Tomcat connector in failed state
at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.initialize(TomcatEmbeddedServletContainer.java:102)
... 12 more
要继续,我必须手动终止正在运行的进程。这是一个错误还是我错过了什么?
最佳答案
在 Windows 7 上运行的 1.1.9 版我仍然会遇到这种情况。
所以在按下 Ctrl C 之后。杀死后台 java 的最快方法是 .
查找java PID
c:\>netstat -ano | find "8080"
TCP 0.0.0.0:8080 0.0.0.0:0 LISTENING 1196
TCP [::]:8080 [::]:0 LISTENING 1196
c:\>taskkill /F /PID 1196
SUCCESS: The process with PID 1196 has been terminated.
我在上面的例子中假设你在 http 端口 8080 上运行
对于 Mac 用户:
$lsof -i :8080
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
java SOME_PID user 417u IPv6 0xa4b3be242c249a27 0t0 TCP *:name (LISTEN)
kill -9 SOME_PID
关于java - 终止 mvn spring-boot :run doesn't stop tomcat,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23432651/
我已经通过 AVD 管理器启动了我的模拟器,一旦它运行,我点击了 run app。我已经等了几分钟,我的正在运行的设备出现在 选择一个正在运行的设备 中,但窗口始终保持空白。 最佳答案 您正在运行的项
我想在安装新数据库之前删除旧数据库,以便为用户更新它。 我有以下情况: 在我的 Components 部分中,我为用户提供了一个选项: [Components] Name: "updateDataba
如果我将一个 Python 模块实现为一个目录(即包),它同时具有顶级函数 run 和子模块 run,我可以指望 from example import run 总是导入函数?根据我的测试,至少在 L
我在 Eclipse Juno 上使用 Tomcat 7。我使用工作区元数据作为服务器位置(请参阅下面的我的 tomcat 配置)。 我也收到了 服务器项目在 eclipse [请看下图] 中使用单独
我正在做一些测试以了解 java 中的不同线程状态,并且遇到了一些查询。 通常,当一个线程被实例化时,它被称为处于 "NEW" 状态,然后当调用它的 start() 方法时,操作系统调度程序获得控制权
当我使用命令 npm run build -- --prod 时,我收到以下错误消息: 属性“PropertyName1”是私有(private)属性,只能在“AppComponent”类中访问 “A
我正在尝试将默认的“运行”键盘快捷键更改为 ⌘R。 - 因为我不想每次都伸手去拿触控板,而且我的手指不够长,无法一次执行⌥⇧F10。 “运行”和“运行...”有什么区别? 最佳答案 ... 用于菜单中
我现在不知道如何编写一个合适的方法来测试这种行为。请不要投反对票.. 我现在有一个 java 类负责处理数据并将数据添加到多个数据库。每个数据库都保存相同的数据,但处理方式不同(例如,以不同的插值率进
我知道不应该调用 run 方法来启动新线程执行,但我指的是 this article他们在另一个 run 方法中调用了 runnable.run(); ,这似乎暗示它启动了一个新线程或者根本没有cre
当我尝试在Windows 10/11下使用Eclipse 2023-06调试任何应用程序(甚至是hello.c)时,我总是收到以下错误:。该错误清楚地指示-(错误2)-路径是错误的。。我试图在互联网上
在运行vue文件时,需要进行npm操作,但我们发现,有时候用的是npm run serve,而有的时候用的是npm run dev,二者有什么区别 在我们运行一些 vue 项目的时候,输入npm ru
我想在 cloud run 上运行一个长时间运行的作业。该任务可能执行超过 30 分钟,并且主要发送 API 请求。cloud run 在大约 20 分钟后停止执行,从指标来看,它似乎没有识别出我的任
我们无法让 SSE 从 Google Cloud Run 上的容器发送。我已经尝试使用一个简单的 SSE 示例( https://github.com/kljensen/node-sse-exampl
直到最近,我一直在执行这个美丽来构建 + 运行一个带有堆栈的项目: stack build && .stack-work/install/x86_64-linux/lts-4.1/7.10.3/bin
我们有一个小脚本,可以抓取网页(约 17 个条目),并将它们写入 Firestore 集合。为此,我们在 Google Cloud Run 上部署了一项服务。 这段代码的执行需要大约 5 秒 when
我是Docker的新手,我知道一种运行交互式容器的方法如下: $ docker run -it image-name bash 要么 $ docker run -it image-name /bin/
Dockerfile 中的多个 RUN 条目之间有什么区别,例如: FROM php:5.6-apache RUN docker-php-ext-install mysqli RUN apt upda
对于来自文档的云运行内存使用情况 ( https://cloud.google.com/run/docs/configuring/memory-limits ) Cloud Run applicati
今天早上我更新了我的 Ubuntu 版本,现在我无法从 eclipse 运行我的应用程序。 问题是,当我单击“运行方式”时出现的列表是空的,我无法运行任何内容。 我该如何解决这个问题? 我能看到的唯一
我正在 intelliJ 上使用 livereload 测试 spring-boot-devtools。我有一个简单的 SpringBootApplication,可以正常工作。 当我从 maven
我是一名优秀的程序员,十分优秀!