1. 程式人生 > >springboot專案第一次啟動報錯

springboot專案第一次啟動報錯

最近,看了一下spring-boot,做了一個demo的工程,啟動時居然報錯,報錯資訊:Unregistering JMX-exposed beans on shutdown。


原來是新版本的spring-boot工程在建立的時,改變了依賴的jar包:

原來的依賴

<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-web</artifactId>
		</dependency>

		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-test</artifactId>
			<scope>test</scope>
		</dependency>

現在的依賴

<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter</artifactId>
		</dependency>

		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-test</artifactId>
			<scope>test</scope>
		</dependency>

在專案的pom檔案中,新增spring-boot-starter-web依賴包即可