正在启动SpringBoot应用程序。在80端口
我想知道是否有可能启动SpringBoot应用程序。在80号港口 我已将端口设置为80,正在启动SpringBoot应用程序。在80端口,spring,spring-boot,spring-mvc,Spring,Spring Boot,Spring Mvc,我想知道是否有可能启动SpringBoot应用程序。在80号港口 我已将端口设置为80,server.port=0080 但我在初始化应用程序时出错 2019-03-31 12:52 [restartedMain] INFO o.a.coyote.http11.Http11NioProtocol.log(173) - Starting ProtocolHandler ["http-nio-80"] 2019-03-31 12:52 [restartedMain] ERROR o.a.cat
server.port=0080
但我在初始化应用程序时出错
2019-03-31 12:52 [restartedMain] INFO o.a.coyote.http11.Http11NioProtocol.log(173) - Starting ProtocolHandler ["http-nio-80"]
2019-03-31 12:52 [restartedMain] ERROR o.a.catalina.util.LifecycleBase.log(175) - 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)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardService.addConnector(StandardService.java:226)
at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.addPreviouslyRemovedConnectors(TomcatWebServer.java:259)
at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.start(TomcatWebServer.java:197)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.startWebServer(ServletWebServerApplicationContext.java:311)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.finishRefresh(ServletWebServerApplicationContext.java:164)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:552)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:142)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:775)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:316)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1260)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1248)
at io.icrypts.ICryptsApplication.main(ICryptsApplication.java:48)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49)
Caused by: java.net.BindException: Address already in use
编号为0–1023的端口称为系统端口或已知端口 这些是保留端口,您不应在该端口范围内运行应用程序 在例外情况下,您可以阅读:
Caused by: java.net.BindException: Address already in use
这意味着有一个服务已经在使用端口80。除非找到已绑定的服务并将其终止,否则无法在该端口上绑定应用程序
同样,不鼓励将端口0–1023用于自定义应用程序
如前所述,最好在端口80上安装apache或nginx,将请求转发到应用程序(应在1024–49151范围内的端口上运行)。可以找到如何设置将80转发到8080的反向代理的示例。只需阅读erorr消息:地址已在使用中。您已经有另一台服务器在端口80中运行。是的,这是可能的,但不鼓励这样做。您应该使用像nginx或apache这样的服务器将请求转发到您的应用程序。