MyBatis MySQL maven项目报错解决

1.java不支持发行版本5

对于当前引用的maven/jar包,jdk的版本过高,可以换成低版本比如jdk1.8

2.Error parsing SQL Mapper Configuration. Cause: java.io.IOException: Could not find resource xxx

Idea不能自动解析java文件夹下的xml文件
解决:pom.xml文件中添加

<build>
        <resources>
            <resource>
                <directory>src/main/java</directory>
                <includes>
                    <include>**/*.xml</include>
                </includes>
            </resource>
        </resources>
    </build>

3.Mapped Statements collection does not contain value for

检查mapper.xml中配置是否正确,比如namespace resultType 全类名等

4.mybatis运行报错:The server time zone value…

解决:需要在url配置中加上时区设置

jdbc:mysql://localhost:3306/eesy?useUnicode=true&amp;characterEncoding=UTF-8&amp;serverTimezone=UTC

5.org.apache.ibatis.binding.BindingException: Type interface XXX is not known to the MapperRegistry

解决:conf.xml或者mapper.xml中的mapper接口、xml文件路径不对
比如 mapper.xml 中的namespace没有配置接口,导致调用getMapper(class)没有找到接口

6.is not known to the MapperRegistry

解决方案类似5

7.Error parsing SQL Mapper Configuration. Cause: org.apache.ibatis.builder.BuilderException: Error par

解决:配置文件有错误
比如settings属性写错了
还有比如把xml中property的属性写到properties文件中时,需要把url中的&am p;换为&

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值