今天用idea搭建ssm框架,看了大佬的文章,一步步地操作,但是还是会有很多问题,然后现在总结一下。
1.mysql和jdbc版本问题。
在搭建完成后启动,若是出现Request processing failed; nested exception is org.springframework.transacti。通常是mysql版本太高,jdbc版本太低导致的。建议升级jdbc版本。
2.mysql证书及时区问题。
- MYSQL:WARN: Establishing SSL connection without server's identity verification is not recommended.这个问题的解决方式是在参数后加useSSL=false或者加useSSL=true。
原文:https://blog.csdn.net/u010429286/article/details/77750177
- You must configure either the server or JDBC driver (via the serverTimezone configuration property) to use a more specifc time zone value if you want to utilize time zone support.”}是时区问题,在参数后加serverTimezone=UTC。
原文:https://blog.csdn.net/u012976879/article/details/85261036
3.ssm中Invalid bound statement (not found)。
这个问题我研究了好久,主要原因是原文中的配置路径和我的路径不一样。
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE configuration
PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-config.dtd">
<configuration>
<typeAliases>
<package name="cn.jpp.entity"/>
</typeAliases>
<mappers>
<!--<mapper resource="cn/happy/entity/IUserInfoDAO.xml" /> -->
<package name="cn.jpp.dao"/>
</mappers>
</configuration>
附上一个知识点:Mybatis配置文件中配置方式。我看了这篇文章才懂的问题出在哪。
https://blog.csdn.net/zxc_helloworld/article/details/78037284
所以如果你把mapper文件和实体类放在同一个包里,那么只需要把路径改成自己的路径,如果是像我一样单独分出来一个包,那么就要用前面注释掉的方法。
最后附上自己参考的搭建框架原文:
https://www.cnblogs.com/jingpeipei/p/6291071.html
注:由于这是本人第一次写博客,若是有什么版权问题我先道个歉,因为我也不是很懂。请您联系我,我会立刻删除文章。谢谢。