[英]Application failed to start
我開始學習springboot並已經遇到錯誤。 我嘗試搜索此錯誤,但找不到它。 我插入了整個錯誤的圖片以及pom.xml和主類的代碼。
pom.xml
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.2.RELEASE</version>
</parent>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
</dependencies>
<properties>
<java.version>1.8</java.version>
</properties>
</project>
主要
package io.java.springbootstarter;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class CourseApiApp {
public static void main(String[] args) {
SpringApplication.run(CourseApiApp.class, args);
}
}
這是錯誤的描述:
The Tomcat connector configured to listen on port 8080 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 8080, or configure this application to listen on another port.
2018-03-21 22:47:48.794 INFO 9412 --- [ main] ationConfigEmbeddedWebApplicationContext : Closing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@f75083: startup date [Wed Mar 21 22:47:46 EDT 2018]; root of context hierarchy
2018-03-21 22:47:48.794 INFO 9412 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Unregistering JMX-exposed beans on shutdown
如果您使用的是linux / mac,則可以嘗試以下命令:
lsof -i :8080
這將返回進程ID以及其他信息,然后使用以下命令終止該進程:
kill -9 your_process_id
這樣,您無需再更改端口。
如果其他進程也是Java進程,則也可以執行jps
來顯示所有正在運行的Java進程並相應地將其殺死。
在使用8080端口時,應使用另一個端口。 您可以通過設置server.port在application.properties中進行配置
對我來說,只需重新啟動計算機即可。 如錯誤消息所述,某些應用程序已在使用指定的端口。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.