元素类型为 "configuration" 的内容必须匹配 "(properties?,settings?,typeAliases?,typeHandlers?

报错主要部分如下:

Error building SqlSession.
### Cause: org.apache.ibatis.builder.BuilderException: Error creating document instance. Cause: org.xml.sax.SAXParseException; lineNumber: 42; columnNumber: 17;

元素类型为 "configuration" 的内容必须匹配 "(properties?,settings?,typeAliases?,typeHandlers?,objectFactory?,objectWrapperFactory?,plugins?,

environments?,databaseIdProvider?,mappers?)"。

这个错误是我在学习mybatis,配置mybatis全局配置文件时发生的错误

出错原因:我在配置文件中使用了个标签:

<settings>

<setting/>

</settings>

然发生报错,原来是我将标签的位置放错了,我觉得(我是小白,我是小白,我是小白)在这个配置文件中,每类标签应该是有顺序的,

即A类型的标签必须写在B类型标签前面。然后我尝试将我使用的标签放到了其他标签之前,问题成功解决。

原文地址:https://www.cnblogs.com/caizhen/p/8727896.html