spring配置初始化出错

昨天配置maven项目的时候,报了一个错误。

警告: Exception thrown from LifecycleProcessor on context close
java.lang.IllegalStateException: LifecycleProcessor not initialized - call 'refresh' before invoking lifecycle methods via the context: Root WebApplicationContext: startup date [Thu Dec 14 23:56:52 CST 2017]; root of context hierarchy
    at org.springframework.context.support.AbstractApplicationContext.getLifecycleProcessor(AbstractApplicationContext.java:416)
    at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:997)
    at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:956)
    at org.springframework.web.context.ContextLoader.closeWebApplicationContext(ContextLoader.java:581)
    at org.springframework.web.context.ContextLoaderListener.contextDestroyed(ContextLoaderListener.java:116)
    at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:4889)
    at org.apache.catalina.core.StandardContext.stopInternal(Stan

相关错误信息

7ee42ba7d1a5f6b93d1b86db45e4ef5b.png

 

 initialized - call 'refresh' before invoking lifecycle methods via the context: Root WebApplicationContext: startup date
先来看一下百度翻译,spring初始化错误
接着去网上找了好久都没有一个好的答案,各类说法都不统一。
有说缺少jar包,有说jdk版本不对,还有说清理下项目重启就可以了。
但是试了一晚上后都不能解决问题。
最后终于在这里找到了问题的原因


Caused by: org.springframework.context.annotation.ConflictingBeanDefinitionException: Annotation-specified bean name 'adminUserRoleService' for bean class [com.rupeng.service.AdminUserRoleService] conflicts with existing, non-compatible bean definition of same name and class [com.rupeng.service.copy.AdminUserRoleServic

提示
 Annotation-specified bean name 'adminUserRoleService' for bean class [com.rupeng.service.AdminUserRoleService] conflicts with existing, non-compatible bean definition of same name and class [com.rupeng.service.copy.AdminUserRoleServic



找到问题存在两个service包冲突,删除copy文件后项目启动成功。
这个错误告诉我们,出了问题查看根异常有多么重要。
也就是Caused by这句话。然后去检查相应的错误就可以了
 
 
 
 
 
 
 
 
 

 

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值