快捷搜索:

Caused by: org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 1; 前言中不允许有内容。

在使用SSM框架时,发生了如下错误:

nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No 
qualifying bean of type [com.cn.apron.web.dao.GoodsSubTypeWebDao] 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)}
Caused by: org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 1; 前言中不允许有内容。

然后自己查错,发现包也是正常扫描到,但是spring容器生成bean时出错,结果,发现自己不小心在对应的Dao.xml文件的最前端加入了不必要的字符,导致出错。

经验分享 程序员 职场和发展