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就可以解决了
  • 相关阅读:
    Github for Windows使用介绍
    Activity生命周期
    Java日期LocalDate使用
    一、安装Windows 2012域控(For SQLServer 2014 AlwaysOn)
    .NET(C#):分析IL中的if-else,while和for语句并用Emit实现
    sqlserver中几种典型的等待
    ServiceStack.Redis常用操作
    ServiceStack.Redis 之 IRedisTypedClient<第四篇>
    ServiceStack.Redis之IRedisClient<第三篇>
    Redis常用命令速查 <第二篇>
  • 原文地址:https://www.cnblogs.com/ITHSZ/p/13781250.html
Copyright © 2011-2022 走看看