zoukankan      html  css  js  c++  java
  • 搭建Mybatis环境遇到的问题

    1. org.apache.ibatis.binding.BindingException: Type interface com.hsz.dao.UserDao is not known to the MapperRegistry.
    
    解决方法:
    
    <!--每一个Mapper.xml都需要在mybatis核心配置文件中注册-->
    <mappers>
        <mapper resource="com/hsz/dao/UserMapper.xml"/>
    </mappers>
    
    
    2. java.lang.ExceptionInInitializerError
    
    解决方法:
    
    <!--在pom.xml中的project标签中配置build,来防止我们资源导出失败的问题-->
    <build>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <excludes>
                    <exclude>**/*.properties</exclude>
                    <exclude>**/*.xml</exclude>
                </excludes>
                <filtering>false</filtering>
            </resource>
            <resource>
                <directory>src/main/java</directory>
                <includes>
                    <include>**/*.properties</include>
                    <include>**/*.xml</include>
                </includes>
                <filtering>false</filtering>
            </resource>
        </resources>
    </build>
    
    3. java.io.IOException: Could not find resource mybatis-config.xml
    
    解决方法:
    将放置mybatis-config.xml的文件夹与src放在同一目录下
    
    
    4.Caused by: java.sql.SQLException: The server time zone value '�й���׼ʱ��' is unrecognized or represents more than one time zone.
    
    解决方法:
    
    时差问题:在URL后面加上serverTimezone=GMT%2B8
    
    如:"jdbc:mysql://localhost:3306/mybatis?useSSL=false&amp;useUnicode=true&amp;characterEncoding=UTF-8&amp;serverTimezone=GMT%2B8"
    
    5. Caused by: java.security.cert.CertPathValidatorException: Path does not chain with any of the trust
    
    解决方法:
    
    原因是因为使用了useSSL=true,只需要改为useSSL=false就可以解决了
  • 相关阅读:
    C# 数据操作系列
    C# 数据操作系列
    C# 基础知识系列- 17 小工具优化
    C# 基础知识系列- 17 实战篇 编写一个小工具(1)
    计算机网络知识概述
    微信公众号开发:消息处理
    微信公众号开发:服务器配置
    C#调用接口注意要点
    npm安装和Vue运行
    实战spring自定义属性(schema)
  • 原文地址:https://www.cnblogs.com/ITHSZ/p/13781250.html
Copyright © 2011-2022 走看看