组件扫描 可能是 与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