Mybatis 配置出现元素类型为 "configuration" 的内容必须匹配 "(properties?,settings?,typeAliases? 。。。报错

Java 2021-01-27 2112℃ 1 0

错误太长,标题写不完
Caused by: org.apache.ibatis.builder.BuilderException: Error creating document instance. Cause: org.xml.sax.SAXParseException; lineNumber: 50; columnNumber: 17; 元素类型为 “configuration” 的内容必须匹配 “(properties?,settings?,typeAliases?,typeHandlers?,objectFactory?,objectWrapperFactory?,reflectorFactory?,plugins?,environments?,databaseIdProvider?,mappers?)”

mybatis-config.xml 配置文件配置时,要注意配置节点顺序

<properties>...</properties>
<settings>...</settings>
<typeAliases>...</typeAliases>
<typeHandlers>...</typeHandlers>
<objectFactory>...</objectFactory>
<objectWrapperFactory>...</objectWrapperFactory>
<plugins>...</plugins>
<environments>...</environments>
<databaseIdProvider>...</databaseIdProvider>
<mappers>...</mappers>

评论 (1)

  • Thanks for finally talking about >Mybatis 配置出现元素类型为 "configuration" 的内容必须匹配 "(properties?,settings?,typeAliases? 。。。报错 - 虾米皮皮乐工作室 <Liked it!

    回复
Top