Spring MVC + mybatis项目错误解决方案汇总
1、启动tomcat时,报java.lang.ClassNotFoundException: org.springframework.web.util.IntrospectorCleanupListener错误,如下图:
解决方法:项目 ->右键 -> 属性 -> Deployment Assembly -> add -> Java Build Path Entries -> next -> Maven Dependencies -> Finish ->Apply -> OK。
2、SAXParseException异常
org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘personDao‘: Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire method: public void com.graduation.dao.BaseDao.setMySqlSessionFactory(org.apache.ibatis.session.SqlSessionFactory); nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘sqlSessionFactory‘ defined in class path resource [conf/core/database.xml]: Invocation of init method failed; nested exception is org.apache.ibatis.builder.BuilderException: Error creating document instance. Cause: org.xml.sax.SAXParseException; lineNumber: 21; columnNumber: 17; 元素类型为 "configuration" 的内容必须匹配 "(properties?,settings?,typeAliases?,typeHandlers?,objectFactory?,objectWrapperFactory?,plugins?,environments?,databaseIdProvider?,mappers?)"。
解决方法:一般是项目的xml配置文件语法错误,认真检查一下就可以了。
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。