Caused by: java.lang.ClassNotFoundException: org.springframework.boot.context.embedded.FilterRegistrationBean
這個錯誤就是由於springboot的版本更新,有些類的路徑發生了變化,
解決辦法:
使用不同的springcloud版本
例如:
我使用的springboot的版本
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.2.RELEASE</version>
</parent>
當我使用springcloud的版本為
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>Brixton.RELEASE</version>
<type>pom</type>
<scope>import</scope>
</dependency>
會出現異常。
只需修改為
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>Dalston.SR1</version>
<type>pom</type>
<scope>import</scope>
</dependency>
就OK了
公眾號
歡迎關注我的公眾號“碼上開發”,每天分享最新技術資訊、最優原創文章。關注獲取最新資源