Spring启动tomcat已成功初始化但未找到侦听端口

时间:2018-02-11 09:42:16

标签: java spring tomcat

我尝试使用netstat -aon | findstr 8088查找端口但未找到。

application.properties:

server.host=localhost
server.port=8088
server.context-path=/
server.tomcat.accesslog.enabled=true
server.tomcat.accesslog.pattern=%t %a "%r" %s (%D ms)

没有任何错误日志的控制台输出:(JDK8 + IDEA + WIN7)

2018-02-11 17:10:26.374 [main] INFO  o.s.b.c.e.tomcat.TomcatEmbeddedServletContainer - Tomcat initialized with port(s): 8088 (http)
2018-02-11 17:10:26.383 [main] INFO  org.apache.catalina.core.StandardService - Starting service [Tomcat]
2018-02-11 17:10:26.384 [main] INFO  org.apache.catalina.core.StandardEngine - Starting Servlet Engine: Apache Tomcat/8.5.16
2018-02-11 17:10:26.510 [localhost-startStop-1] INFO  o.a.c.core.ContainerBase.[Tomcat].[localhost].[/] - Initializing Spring embedded WebApplicationContext
2018-02-11 17:10:26.510 [localhost-startStop-1] DEBUG org.springframework.web.context.ContextLoader - Published root WebApplicationContext as ServletContext attribute with name [org.springframework.web.context.WebApplicationContext.ROOT]
2018-02-11 17:10:26.510 [localhost-startStop-1] INFO  org.springframework.web.context.ContextLoader - Root WebApplicationContext: initialization completed in 1636 ms

最后,我更改为已经使用的端口然后启动应用程序,它仍然打印成功日志,LOL,没有找到任何错误日志,我该如何找到问题?

1 个答案:

答案 0 :(得分:0)

是的,我自己找到了原因,一个@Bean阻止了spring init主线程,tomcat绑定还没有。这太荒谬了。这个bean是netty,我必须改变另一种方式init。