[英]Spring Boot - rmi connection error during initialization
我在启动由 spring 初始值设定项创建的 Spring Boot 应用程序时遇到问题。
mvn 命令堆栈跟踪
[DEBUG] Application argument(s): --spring.application.admin.enabled=true --spring.application.admin.jmx-name=org.springframework.boot:type=Admin,name=SpringApplication
[DEBUG] Environment variable(s):
[DEBUG] Connecting to local MBeanServer at port 9001
[DEBUG] Waiting for spring application to start...
[DEBUG] MBean server at port 9001 is not up yet...
[DEBUG] Spring application is not ready yet, waiting 500ms (attempt 1)
[DEBUG] Connected to local MBeanServer at port 9001
[DEBUG] Waiting for spring application to start...
[DEBUG] Spring application is not ready yet, waiting 500ms (attempt 1)
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v2.5.6)
2021-11-01 12:40:43.639 INFO 37902 --- [ main] com.example.demo1.Demo1Application : Starting Demo1Application using Java 17 on dj-legion with PID 37902 (/home/dj/Documents/demo1/target/classes started by dj in /home/dj/Documents/demo1)
2021-11-01 12:40:43.642 INFO 37902 --- [ main] com.example.demo1.Demo1Application : No active profile set, falling back to default profiles: default
[DEBUG] Spring application is not ready yet, waiting 500ms (attempt 2)
2021-11-01 12:40:44.185 INFO 37902 --- [ main] com.example.demo1.Demo1Application : Started Demo1Application in 0.947 seconds (JVM running for 1.53)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.931 s
[INFO] Finished at: 2021-11-01T12:40:44+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.5.6:start (default-cli) on project demo1: Could not figure out if the application has started: Failed to connect to MBean server at port 9001: Could not invoke shutdown operation: Connection refused to host: 127.0.0.1; nested exception is:
[ERROR] java.net.ConnectException: Connection refused
你知道如何解决这种错误吗? 我尝试过使用较低的 java/maven/spring-boot 版本,但没有成功。
解决方法很简单。 我忘记了网络依赖,应用程序立即完成。
只需添加到您的pom.xml
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.