当前位置: 代码迷 >> 综合 >> Context initialization failed org.springframework.beans.factory.BeanDefinitionStoreException: Failed
  详细解决方案

Context initialization failed org.springframework.beans.factory.BeanDefinitionStoreException: Failed

热度:53   发布时间:2023-11-24 04:35:58.0

组件扫描 可能是 与jdk版本有关
使用组件扫描器省去在spring容器配置每个controller类的繁琐。使用<context:component-scan自动扫描标记@controller的控制器类,配置如下:

<context:component-scan base-package="cn.itcast.springmvc.ssm.controller"/>

出错:

Context initialization failed org.springframework.beans.factory.BeanDefinitionStoreException: Failed to read candidate component class: file

与之相似的问题已经解决:问题出在了将jdk版本1.8换成了1.7就OK了,,,,如下

org.springframework.beans.factory.BeanDefinitionStoreException: Failed to read candidate component class: file [/Users/yeyue/Documents/workspace/cloudnote/build/classes/com/gxl/cloudnote/dao/UserDao.class]; nested exception is org.springframework.core.NestedIOException

  相关解决方案