端口占用问题:The Tomcat connector configured to listen on port 80 failed to start. The port may already be

The Tomcat connector configured to listen on port 80 failed to start. The port may already be in use or the connector may be misconfigured.

最近做一个综合项目 遇到的一个小问题
错误提示如下:
给了以下几个建议
. ____ _ __ _ _
/\ / __ _ () __ __ _ \ \ \
( ( )_
_ | '_ | '| | ’ / ` | \ \ \
\/ )| |)| | | | | || (| | ) ) ) )
’ |
| .__|| ||| |__, | / / / /
=|_|======|/=////
:: Spring Boot :: (v2.1.9.RELEASE)

2019-10-14 21:08:18.923 INFO 12696 — [ restartedMain] com.cy.Application : Starting Application on Lenovo-PC with PID 12696 (G:\SogouInput\eclipse\java\1907STS\CGB-DB-SYS-V2.02\target\classes started by 2280250091 in G:\SogouInput\eclipse\java\1907STS\CGB-DB-SYS-V2.02)
2019-10-14 21:08:18.927 DEBUG 12696 — [ restartedMain] com.cy.Application : Running with Spring Boot v2.1.9.RELEASE, Spring v5.1.10.RELEASE
2019-10-14 21:08:18.929 INFO 12696 — [ restartedMain] com.cy.Application : No active profile set, falling back to default profiles: default
2019-10-14 21:08:19.058 INFO 12696 — [ restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : Devtools property defaults active! Set ‘spring.devtools.add-properties’ to ‘false’ to disable
2019-10-14 21:08:19.058 INFO 12696 — [ restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : For additional web related logging consider setting the ‘logging.level.web’ property to ‘DEBUG’
2019-10-14 21:08:21.529 INFO 12696 — [ restartedMain] trationDelegate B e a n P o s t P r o c e s s o r C h e c k e r : B e a n ′ o r g . s p r i n g f r a m e w o r k . t r a n s a c t i o n . a n n o t a t i o n . P r o x y T r a n s a c t i o n M a n a g e m e n t C o n f i g u r a t i o n ′ o f t y p e [ o r g . s p r i n g f r a m e w o r k . t r a n s a c t i o n . a n n o t a t i o n . P r o x y T r a n s a c t i o n M a n a g e m e n t C o n f i g u r a t i o n BeanPostProcessorChecker : Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration BeanPostProcessorChecker:Beanorg.springframework.transaction.annotation.ProxyTransactionManagementConfigurationoftype[org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration E n h a n c e r B y S p r i n g C G L I B EnhancerBySpringCGLIB EnhancerBySpringCGLIB$9d9f12e9] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2019-10-14 21:08:22.721 INFO 12696 — [ restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 80 (http)
2019-10-14 21:08:22.786 INFO 12696 — [ restartedMain] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2019-10-14 21:08:22.798 INFO 12696 — [ restartedMain] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.26]
2019-10-14 21:08:23.032 INFO 12696 — [ restartedMain] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2019-10-14 21:08:23.032 INFO 12696 — [ restartedMain] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 3974 ms
2019-10-14 21:08:24.332 INFO 12696 — [ restartedMain] o.s.s.concurrent.ThreadPoolTaskExecutor : Initializing ExecutorService ‘applicationTaskExecutor’
2019-10-14 21:08:24.606 INFO 12696 — [ restartedMain] o.s.b.a.w.s.WelcomePageHandlerMapping : Adding welcome page template: index
2019-10-14 21:08:26.744 WARN 12696 — [ restartedMain] o.s.b.d.a.OptionalLiveReloadServer : Unable to start LiveReload server
2019-10-14 21:08:26.760 INFO 12696 — [ restartedMain] o.s.b.a.e.web.EndpointLinksResolver : Exposing 2 endpoint(s) beneath base path ‘/actuator’
2019-10-14 21:08:26.868 ERROR 12696 — [ restartedMain] org.apache.catalina.util.LifecycleBase : Failed to start component [Connector[HTTP/1.1-80]]

org.apache.catalina.LifecycleException: Protocol handler start failed
at org.apache.catalina.connector.Connector.startInternal(Connector.java:1008) ~[tomcat-embed-core-9.0.26.jar:9.0.26]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) ~[tomcat-embed-core-9.0.26.jar:9.0.26]
at org.apache.catalina.core.StandardService.addConnector(StandardService.java:227) [tomcat-embed-core-9.0.26.jar:9.0.26]
at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.addPreviouslyRemovedConnectors(TomcatWebServer.java:263) [spring-boot-2.1.9.RELEASE.jar:2.1.9.RELEASE]
at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.start(TomcatWebServer.java:195) [spring-boot-2.1.9.RELEASE.jar:2.1.9.RELEASE]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.startWebServer(ServletWebServerApplicationContext.java:297) [spring-boot-2.1.9.RELEASE.jar:2.1.9.RELEASE]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.finishRefresh(ServletWebServerApplicationContext.java:163) [spring-boot-2.1.9.RELEASE.jar:2.1.9.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:552) [spring-context-5.1.10.RELEASE.jar:5.1.10.RELEASE]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141) [spring-boot-2.1.9.RELEASE.jar:2.1.9.RELEASE]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:744) [spring-boot-2.1.9.RELEASE.jar:2.1.9.RELEASE]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:391) [spring-boot-2.1.9.RELEASE.jar:2.1.9.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:312) [spring-boot-2.1.9.RELEASE.jar:2.1.9.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1215) [spring-boot-2.1.9.RELEASE.jar:2.1.9.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1204) [spring-boot-2.1.9.RELEASE.jar:2.1.9.RELEASE]
at com.cy.Application.main(Application.java:10) [classes/:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_161]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_161]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_161]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_161]
at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49) [spring-boot-devtools-2.1.9.RELEASE.jar:2.1.9.RELEASE]
Caused by: java.net.BindException: Address already in use: bind
at sun.nio.ch.Net.bind0(Native Method) ~[na:1.8.0_161]
at sun.nio.ch.Net.bind(Net.java:433) ~[na:1.8.0_161]
at sun.nio.ch.Net.bind(Net.java:425) ~[na:1.8.0_161]
at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223) ~[na:1.8.0_161]
at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74) ~[na:1.8.0_161]
at org.apache.tomcat.util.net.NioEndpoint.initServerSocket(NioEndpoint.java:230) ~[tomcat-embed-core-9.0.26.jar:9.0.26]
at org.apache.tomcat.util.net.NioEndpoint.bind(NioEndpoint.java:213) ~[tomcat-embed-core-9.0.26.jar:9.0.26]
at org.apache.tomcat.util.net.AbstractEndpoint.bindWithCleanup(AbstractEndpoint.java:1124) ~[tomcat-embed-core-9.0.26.jar:9.0.26]
at org.apache.tomcat.util.net.AbstractEndpoint.start(AbstractEndpoint.java:1210) ~[tomcat-embed-core-9.0.26.jar:9.0.26]
at org.apache.coyote.AbstractProtocol.start(AbstractProtocol.java:585) ~[tomcat-embed-core-9.0.26.jar:9.0.26]
at org.apache.catalina.connector.Connector.startInternal(Connector.java:1005) ~[tomcat-embed-core-9.0.26.jar:9.0.26]
… 19 common frames omitted

2019-10-14 21:08:26.877 INFO 12696 — [ restartedMain] o.apache.catalina.core.StandardService : Stopping service [Tomcat]
2019-10-14 21:08:26.891 INFO 12696 — [ restartedMain] ConditionEvaluationReportLoggingListener :

Error starting ApplicationContext. To display the conditions report re-run your application with ‘debug’ enabled.
2019-10-14 21:08:26.897 ERROR 12696 — [ restartedMain] o.s.b.d.LoggingFailureAnalysisReporter :


APPLICATION FAILED TO START


Description:

The Tomcat connector configured to listen on port 80 failed to start. The port may already be in use or the connector may be misconfigured.

Action:

Verify the connector’s configuration, identify and stop any process that’s listening on port 80, or configure this application to listen on another port.

2019-10-14 21:08:26.904 INFO 12696 — [ restartedMain] o.s.s.concurrent.ThreadPoolTaskExecutor : Shutting down ExecutorService ‘applicationTaskExecutor’

根据提示可以看出是端口占用问题
方案一:关掉软件重新启动,我就是这么稀里糊涂搞定的…勿喷
方案二:
1.打开cmd界面(快捷键Win+r)
2.输入netstat -ano
netstat -ano.
3找到被占用的端口
4.输入命令tasklist|findstr “4496”

tasklist|findstr "6148"

PS:
找不到被占用的端口号
我的是这个:在这里插入图片描述
这里有一个小技巧我的端口号是80找到和80相同的序列号 终止就好了

你可能感兴趣的:(Java项目)