微服务启动出现错误Failed to process import candidates for configuration class [xxxxx]; nested exception is java.lang.IllegalStateException: Failed to introspect annotated methods

问题描述:微服务启动出现错误

org.springframework.beans.factory.BeanDefinitionStoreException: Failed to process import candidates for configuration class [xxxxx]; nested exception is java.lang.IllegalStateException: Failed to introspect annotated methods on class org.springframework.session.config.annotation.web.http.SpringHttpSessionConfiguration

解决

  1. 这个问题单纯从错误上看,可能会被引导到认为是哪个引入有问题,从而去寻找具体的一个问题去解决

  2. 实际上是boot项目的pom依赖对应包的<scope>有关

方法一

  1. 如果仅仅是一个依赖的启动有问题,例如java.servlet:解决如下:将范围从provided—>compile

    在这里插入图片描述
    在这里插入图片描述

    1. 若是报多个错误的话,建议如下修改

      1.右上角启动小三角 -->Edit configuration–>-右侧Modify options----> 找到带有“provided”字样的选项打勾 --> 重新启动工程运行即可。
      在这里插入图片描述
      在这里插入图片描述

总结:出现这个问题,很大程度上都是maven工程依赖的问题,可以围绕依赖从多方面修改引入,当然如果你的项目pom本身就没有引入相关依赖,那肯定是不行的!!需要先引入对应依赖

Logo

AtomGit 是由开放原子开源基金会联合 CSDN 等生态伙伴共同推出的新一代开源与人工智能协作平台。平台坚持“开放、中立、公益”的理念,把代码托管、模型共享、数据集托管、智能体开发体验和算力服务整合在一起,为开发者提供从开发、训练到部署的一站式体验。

更多推荐