mybatis核心配置文件中,添加日志的标准输出:
测试报如下错误。(备注:去掉标准日志的配置,测试正常。)
### Error building SqlSession.
### The error may exist in SQL Mapper Configuration
### Cause: org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: org.apache.ibatis.builder.BuilderException: The setting logImpl is not known. Make sure you spelled it correctly (case sensitive).
at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:8)
at org.apache.ibatis.session.SqlSessionFactoryBuilder.build(SqlSessionFactoryBuilder.java:50)
at org.apache.ibatis.session.SqlSessionFactoryBuilder.build(SqlSessionFactoryBuilder.java:33)
at com.utils.jin.MybatisUtils.<clinit>(MybatisUtils.java:24)
... 23 more
Caused by: org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: org.apache.ibatis.builder.BuilderException: The setting logImpl is not known. Make sure you spelled it correctly (case sensitive).
at org.apache.ibatis.builder.xml.XMLConfigBuilder.parseConfiguration(XMLConfigBuilder.java:85)
at org.apache.ibatis.builder.xml.XMLConfigBuilder.parse(XMLConfigBuilder.java:69)
at org.apache.ibatis.session.SqlSessionFactoryBuilder.build(SqlSessionFactoryBuilder.java:47)
... 25 more
Caused by: org.apache.ibatis.builder.BuilderException: The setting logImpl is not known. Make sure you spelled it correctly (case sensitive).
at org.apache.ibatis.builder.xml.XMLConfigBuilder.settingsElement(XMLConfigBuilder.java:168)
at org.apache.ibatis.builder.xml.XMLConfigBuilder.parseConfiguration(XMLConfigBuilder.java:80)
... 27 more
解决方法
详见以下作者的解释:
https://my.oschina.net/mengzhang6/blog/2877336?nocache=1544089048224
mybatis的版本换成3.2.7或以上,此问题解决。
MyBatis 3.1.1 -jar还没有 logImpl 这个设置,换成MyBatis 3.2.7 -jar解决。