mybatis解析xml配置文件出现报错:
org.apache.ibatis.exceptions.PersistenceException:
### Error building SqlSession.
### Cause: org.apache.ibatis.builder.BuilderException: Error creating document instance. Cause: org.xml.sax.SAXParseException; lineNumber: 36; columnNumber: 17; 元素类型为 "configuration" 的内容必须匹配 "(properties?,settings?,typeAliases?,typeHandlers?,objectFactory?,objectWrapperFactory?,reflectorFactory?,plugins?,environments?,databaseIdProvider?,mappers?)"。
原因:
这个报错是因为你配置的标签顺序不对
按照报错信息的标签顺序去书写你的配置信息
从先到后必须是:
properties => settings => typeAliases => typeHandlers =>objectFactory =>objectWrapperFactory => reflectorFactory =>plugins => environments =>databaseIdProvider => mappers
调整顺序后问题解决。