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,再次运行

<parent>
                   <groupId>org.springframework.boot</groupId>
                   <artifactId>spring-boot-starter-parent</artifactId>
                   <!-- <version>1.3.7.RELEASE</version> -->
                            <version>1.5.6.RELEASE</version>
                   <relativePath/> <!-- lookup parent from repository -->
         </parent>

报错如下:


原因分析:找不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即可解决问题。

<dependencyManagement>

              <dependencies>

                     <dependency>

                            <groupId>org.springframework.cloud</groupId>

                            <artifactId>spring-cloud-dependencies</artifactId>

                              <!--      <version>Brixton.SR5</version>-->

                   <version>Dalston.SR3</version>

                            <type>pom</type>

                            <scope>import</scope>

                     </dependency>

              </dependencies>

       </dependencyManagement>

 

 

 

 


o.s.b.web.embedded.tomcat.TomcatStarter : Error starting Tomcat context. Exception: org.springframework.beans.factory.UnsatisfiedDependencyException. Message: Error creating bean with name 'securityConfig': Unsatisfied dependency expressed through field 'loginSuccessHandler'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'loginSuccessHandler': Unsatisfied dependency expressed through field 'staffService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'staffServiceImpl': Unsatisfied dependency expressed through field 'baseMapper'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'staffMapper' defined in URL [jar:file:/D:/javaProject/mbyy/yydgy_manage_client_boot/target/yydgy_manage_client_boot-0.0.1-SNAPSHOT.jar!/BOOT-INF/classes!/com/yydgy_manage_client_boot/mapper/StaffMapper.class]: Unsatisfied dependency expressed through bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [com/baomidou/mybatisplus/autoconfigure/MybatisPlusAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.ibatis.session.SqlSessionFactory]: Factory method 'sqlSessionFactory' threw exception; nested exception is java.lang.NoClassDefFoundError: lombok/Data如何解决你?
05-24
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值