org.springframework.context.ApplicationContextException: Failed to start bean 'webServerStartStop'; nested exception is org.springframework.boot.web.server.WebServerException: Unable to start embedded Jetty server
at org.springframework.context.support.DefaultLifecycleProcessor$LifecycleGroup.start(DefaultLifecycleProcessor.java:356) ~[spring-context-5.3.5.jar!/:5.3.5]
at java.base/java.lang.Iterable.forEach(Iterable.java:75) ~[na:na]
at org.springframework.context.support.DefaultLifecycleProcessor.startBeans(DefaultLifecycleProcessor.java:155) ~[spring-context-5.3.5.jar!/:5.3.5]
at org.springframework.context.support.DefaultLifecycleProcessor.onRefresh(DefaultLifecycleProcessor.java:123) ~[spring-context-5.3.5.jar!/:5.3.5]
at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:935) ~[spring-context-5.3.5.jar!/:5.3.5]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:586) ~[spring-context-5.3.5.jar!/:5.3.5]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:144) ~[spring-boot-2.5.0-M3.jar!/:2.5.0-M3]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:761) ~[spring-boot-2.5.0-M3.jar!/:2.5.0-M3]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:430) ~[spring-boot-2.5.0-M3.jar!/:2.5.0-M3]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:328) ~[spring-boot-2.5.0-M3.jar!/:2.5.0-M3]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1325) ~[spring-boot-2.5.0-M3.jar!/:2.5.0-M3]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1314) ~[spring-boot-2.5.0-M3.jar!/:2.5.0-M3]
at run.halo.app.Application.main(Application.java:21) ~[classes!/:1.4.8]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:na]
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
at java.base/java.lang.reflect.Method.invoke(Method.java:566) ~[na:na]
at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:49) ~[halo.jar:1.4.8]
at org.springframework.boot.loader.Launcher.launch(Launcher.java:107) ~[halo.jar:1.4.8]
at org.springframework.boot.loader.Launcher.launch(Launcher.java:58) ~[halo.jar:1.4.8]
at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:88) ~[halo.jar:1.4.8]
Caused by: org.springframework.boot.web.server.WebServerException: Unable to start embedded Jetty server
at org.springframework.boot.web.embedded.jetty.JettyWebServer.start(JettyWebServer.java:181) ~[spring-boot-2.5.0-M3.jar!/:2.5.0-M3]
at org.springframework.boot.web.servlet.context.WebServerStartStopLifecycle.start(WebServerStartStopLifecycle.java:43) ~[spring-boot-2.5.0-M3.jar!/:2.5.0-M3]
at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:178) ~[spring-context-5.3.5.jar!/:5.3.5]
... 22 common frames omitted
Caused by: java.io.IOException: Failed to bind to /0.0.0.0:80
at org.eclipse.jetty.server.ServerConnector.openAcceptChannel(ServerConnector.java:349) ~[jetty-server-9.4.38.v20210224.jar!/:9.4.38.v20210224]
at org.eclipse.jetty.server.ServerConnector.open(ServerConnector.java:310) ~[jetty-server-9.4.38.v20210224.jar!/:9.4.38.v20210224]
at org.eclipse.jetty.server.AbstractNetworkConnector.doStart(AbstractNetworkConnector.java:80) ~[jetty-server-9.4.38.v20210224.jar!/:9.4.38.v20210224]
at org.eclipse.jetty.server.ServerConnector.doStart(ServerConnector.java:234) ~[jetty-server-9.4.38.v20210224.jar!/:9.4.38.v20210224]
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:73) ~[jetty-util-9.4.38.v20210224.jar!/:9.4.38.v20210224]
at org.springframework.boot.web.embedded.jetty.JettyWebServer.start(JettyWebServer.java:161) ~[spring-boot-2.5.0-M3.jar!/:2.5.0-M3]
... 24 common frames omitted
Caused by: java.net.SocketException: Permission denied
at java.base/sun.nio.ch.Net.bind0(Native Method) ~[na:na]
at java.base/sun.nio.ch.Net.bind(Net.java:461) ~[na:na]
at java.base/sun.nio.ch.Net.bind(Net.java:453) ~[na:na]
at java.base/sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:227) ~[na:na]
at java.base/sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:80) ~[na:na]
at org.eclipse.jetty.server.ServerConnector.openAcceptChannel(ServerConnector.java:344) ~[jetty-server-9.4.38.v20210224.jar!/:9.4.38.v20210224]
... 29 common frames omitted
2021-06-03 17:25:22.150 INFO 3957 --- [main] run.halo.app.Application : Starting Application v1.4.8 using Java 11 on iZl8b9ulg0x03pZ with PID 3957 (/home/halo/app/halo.jar started by halo in /)
2021-06-03 17:25:22.160 INFO 3957 --- [main] run.halo.app.Application : No active profile set, falling back to default profiles: default
2021-06-03 17:25:25.178 INFO 3957 --- [main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFAULT mode.
2021-06-03 17:25:25.630 INFO 3957 --- [main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 436 ms. Found 22 JPA repository interfaces.
2021-06-03 17:25:28.149 INFO 3957 --- [main] org.eclipse.jetty.util.log : Logging initialized @9084ms to org.eclipse.jetty.util.log.Slf4jLog
2021-06-03 17:25:28.624 INFO 3957 --- [main] o.s.b.w.e.j.JettyServletWebServerFactory : Server initialized with port: 80
2021-06-03 17:25:28.645 INFO 3957 --- [main] org.eclipse.jetty.server.Server : jetty-9.4.38.v20210224; built: 2021-02-24T20:25:07.675Z; git: 288f3cc74549e8a913bf363250b0744f2695b8e6; jvm 11+28
2021-06-03 17:25:28.721 INFO 3957 --- [main] o.e.j.s.h.ContextHandler.application : Initializing Spring embedded WebApplicationContext
2021-06-03 17:25:28.723 INFO 3957 --- [main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 6392 ms
2021-06-03 17:25:31.023 INFO 3957 --- [main] o.hibernate.jpa.internal.util.LogHelper : HHH000204: Processing PersistenceUnitInfo [name: default]
2021-06-03 17:25:31.169 INFO 3957 --- [main] org.hibernate.Version : HHH000412: Hibernate ORM core version 5.4.29.Final
2021-06-03 17:25:31.299 INFO 3957 --- [main] o.hibernate.annotations.common.Version : HCANN000001: Hibernate Commons Annotations {5.1.2.Final}
2021-06-03 17:25:31.669 INFO 3957 --- [main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting...
2021-06-03 17:25:32.233 INFO 3957 --- [main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Start completed.
2021-06-03 17:25:32.332 INFO 3957 --- [main] org.hibernate.dialect.Dialect : HHH000400: Using dialect: org.hibernate.dialect.H2Dialect
2021-06-03 17:25:35.536 INFO 3957 --- [main] o.h.e.t.j.p.i.JtaPlatformInitiator : HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform]
2021-06-03 17:25:35.562 INFO 3957 --- [main] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'
2021-06-03 17:25:36.385 INFO 3957 --- [main] run.halo.app.config.HaloConfiguration : Halo cache store load impl : [class run.halo.app.cache.InMemoryCacheStore]
2021-06-03 17:25:37.750 INFO 3957 --- [main] org.eclipse.jetty.server.session : DefaultSessionIdManager workerName=node0
2021-06-03 17:25:37.751 INFO 3957 --- [main] org.eclipse.jetty.server.session : No SessionScavenger set, using defaults
2021-06-03 17:25:37.754 INFO 3957 --- [main] org.eclipse.jetty.server.session : node0 Scavenging every 660000ms
2021-06-03 17:25:37.776 INFO 3957 --- [main] o.e.jetty.server.handler.ContextHandler : Started o.s.b.w.e.j.JettyEmbeddedWebAppContext@2707c790{application,/,[file:///tmp/jetty-docbase.80.3394511601801419655/, jar:file:/home/halo/app/halo.jar!/BOOT-INF/lib/springfox-swagger-ui-3.0.0.jar!/META-INF/resources],AVAILABLE}
2021-06-03 17:25:37.777 INFO 3957 --- [main] org.eclipse.jetty.server.Server : Started @18715ms
2021-06-03 17:25:38.442 INFO 3957 --- [main] run.halo.app.handler.file.FileHandlers : Registered 9 file handler(s)
报错如上图所示, 设置为8080 或者 8090端口正常 , 是80 就不允许使用,必须要反向代理吗?
希望解答下
[root@iZl8b9ulg0x03pZ ~]# lsof -i:80
[root@iZl8b9ulg0x03pZ ~]# netstat -anp|grep 80
tcp 0 0 172.17.253.133:48534 100.100.105.70:80 TIME_WAIT -
tcp 0 0 172.17.253.133:35652 100.100.30.25:80 TIME_WAIT -
tcp 0 0 172.17.253.133:48530 100.100.105.70:80 TIME_WAIT -
tcp 0 0 172.17.253.133:48536 100.100.105.70:80 TIME_WAIT -
udp 0 0 0.0.0.0:68 0.0.0.0:* 800/dhclient
unix 2 [ ] DGRAM 15730 800/dhclient