删除Daos /控制器后甚至出现bean错误

时间:2015-03-16 16:06:49

标签: java spring spring-mvc netbeans

我一直收到以下错误:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'testController': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: testDao controller.testController.testDao; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [testDao] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)

即使我删除了这个testController和DAO,我仍然继续得到它,即使我的其他控制器等工作正常。我尝试清除缓存/索引文件,但似乎没有解决它。它还在某处缓存吗?或者我的问题有解决方案吗?

1 个答案:

答案 0 :(得分:0)

Controller和Dao的.class文件可能仍在构建目录中。点击Netbeans中的Run > Clean and Build Project..,尝试清理和重建项目。 编辑:如果在服务器上运行它,请尝试从服务器删除项目并再次部署它。