Я сделал проект весенней загрузки.
Когда я делаю банку с использованием windows 10 и запускаюсь на моей машине windows, она работает без проблем.
Когда я пытаюсь при запуске его на Debian 10 или CentOS 8 с установленным Java 8 я получаю
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2020-02-02 20:22:13.050 ERROR 14537 --- [ main] o.s.boot.SpringApplication : Application run failed
org.springframework.boot.web.server.WebServerException: Unable to start embedded Jetty server
at org.springframework.boot.web.embedded.jetty.JettyWebServer.start(JettyWebServer.java:165) ~[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 ptoject.web.Application.main(Application.java:14) [classes!/:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_232]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_232]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_232]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_232]
at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48) [web-4.jar:na]
at org.springframework.boot.loader.Launcher.launch(Launcher.java:87) [web-4.jar:na]
at org.springframework.boot.loader.Launcher.launch(Launcher.java:51) [web-4.jar:na]
at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:52) [web-4.jar:na]
Caused by: java.net.SocketException: Permission denied
at sun.nio.ch.Net.bind0(Native Method) ~[na:1.8.0_232]
at sun.nio.ch.Net.bind(Net.java:433) ~[na:1.8.0_232]
at sun.nio.ch.Net.bind(Net.java:425) ~[na:1.8.0_232]
at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223) ~[na:1.8.0_232]
at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74) ~[na:1.8.0_232]
at org.eclipse.jetty.server.ServerConnector.openAcceptChannel(ServerConnector.java:342) ~[jetty-server-9.4.19.v20190610.jar!/:9.4.19.v20190610]
at org.eclipse.jetty.server.ServerConnector.open(ServerConnector.java:308) ~[jetty-server-9.4.19.v20190610.jar!/:9.4.19.v20190610]
at org.eclipse.jetty.server.AbstractNetworkConnector.doStart(AbstractNetworkConnector.java:80) ~[jetty-server-9.4.19.v20190610.jar!/:9.4.19.v20190610]
at org.eclipse.jetty.server.ServerConnector.doStart(ServerConnector.java:236) ~[jetty-server-9.4.19.v20190610.jar!/:9.4.19.v20190610]
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68) ~[jetty-util-9.4.19.v20190610.jar!/:9.4.19.v20190610]
at org.springframework.boot.web.embedded.jetty.JettyWebServer.start(JettyWebServer.java:146) ~[spring-boot-2.1.9.RELEASE.jar!/:2.1.9.RELEASE]
Если вам нужна помощь, это мой файл build.gradle
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:2.1.9.RELEASE")
}
}
plugins {
id 'org.springframework.boot' version '2.1.9.RELEASE'
id 'io.spring.dependency-management' version '1.0.8.RELEASE'
id 'java'
id 'application'
}
group = 'project'
version = '4'
mainClassName = "project.web.Application"
repositories {
mavenCentral()
}
dependencies {
compile("org.springframework.boot:spring-boot-starter-web") {
exclude group: 'org.springframework.boot', module: 'spring-boot-starter-tomcat'
}
compile('org.springframework.boot:spring-boot-starter-data-jpa') {
exclude group: 'org.apache.tomcat', module: 'tomcat-jdbc'
}
implementation 'org.springframework.boot:spring-boot-starter-jetty'
implementation 'org.springframework.boot:spring-boot-starter-freemarker'
implementation 'org.springframework.boot:spring-boot-starter-jdbc'
implementation 'org.springframework.boot:spring-boot-starter-mail';
implementation 'com.h2database:h2'
implementation 'org.webjars:jquery:3.1.0'
implementation 'commons-validator:commons-validator:1.6'
}
jar {
// include all the jars
from {
configurations.compile.collect { it.isDirectory() ? it : zipTree(it) }
(configurations.runtime).collect {
it.isDirectory() ? it : zipTree(it)
}
}
manifest {
attributes 'Main-Class': 'web.Application'
}
}
Я нахожусь на полная потеря в том, почему это происходит
Debian 10 и CentOS 8 имеют
openjdk version "1.8.0_232"
OpenJDK Runtime Environment (build 1.8.0_232-b09)
OpenJDK 64-Bit Server VM (build 25.232-b09, mixed mode)
И windows машина имеет
java version "1.8.0_241"
Java(TM) SE Runtime Environment (build 1.8.0_241-b07)
Java HotSpot(TM) 64-Bit Server VM (build 25.241-b07, mixed mode)