java.lang.NoClassDefFoundError: org/springframework/boot/context/embedded/FilterRegistrationBean

今天运行《spring cloud 微服务实战》的服务跟踪的例子,把pom.xml 中的spring-boot-starter-parent的version由1.3.7.RELEASE改为现在的1.5.6.RELEASE,再次运行


                   org.springframework.boot
                   spring-boot-starter-parent
                  
                            1.5.6.RELEASE
                  
        

报错如下:


原因分析:找不org.springframework.boot.context.embedded.FilterRegistrationBean,查看源码发现:在1.5.6版本中FilterRegistrationBean的包路径已经改为org.springframework.boot.web.servlet.org.springframework.boot.web.servlet.FilterRegistrationBean,所以引发错误。

解决办法:既然是引用了以前的包路径,说明是pom.xml文件的问题。检查发现spring-cloud-dependencies 的版本没有更新,改为Dalston.SR3即可解决问题。

             

                    

                            org.springframework.cloud

                            spring-cloud-dependencies

                              

                   Dalston.SR3

                            pom

                            import

                    

             

      

 

 

 

 


你可能感兴趣的:(springcloud)