使用IDEA 打开jeeplus框架的项目

项目结构:


image.png

开发工具:IDEA Ultimate

过程:

1.打开IDEA

点击:
File-New-Project from Existing Sources


image.png

2.选择项目文件中的pom.xml,点击OK

image.png

3.一路next

image.png

image.png

image.png

4.等待项目导入成功后,配置run 方式点击右上角的

image.png

点击+号,选择maven


image.png

在 Command line 填上tomcat7:run,点击ok,完成配置


image.png

5.修改数据库连接配置

打开/src/main/resources/properties/jeeplus.properties
修改mysql数据库配置

#mysql database setting
jdbc.type=mysql
jdbc.driver=com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql://localhost:3306/gymnasium?useUnicode=true&characterEncoding=utf-8
jdbc.username=root
jdbc.password=shine2015
jdbc.testSql=SELECT 'x'
jdbc.dual =

6.运行项目

运行前准备:
1.启动redis服务


image.png

错误:

1.没有启动redis服务


image.png

2.一直报错:


image.png

排错历程:
1.起初以为是/src/main/resources/properties/jeeplus.properties里的mysql配置不正确,多次修改还是出现问题
2.怀疑 数据库gymnasium 导入出现问题
多次用Navicat for MySQL 导入数据库,运行项目还是报错
3.然后怀疑是用idea 导入项目 出现问题
尝试使用eclipse导入项目,
4.建新帮忙查找问题,他使用IDEA导入项目 运行没问题,mysql的版本是5.5,我的mysql版本是8.0
5.重新安装mysql5.7 后,运行项目就没问题了

总结:
错误原因: mysql数据库版本8 ,项目的jdbc驱动不支持

参考:https://blog.csdn.net/wanglong1221/article/details/81148146

1、驱动包要升级为 mysql-connector-java-8.0.11.jar
2、JDBC driver 由“com.mysql.jdbc.Driver”改为“com.mysql.cj.jdbc.Driver”
3、url中加上“userSSL=false”。否则会出现以下错误:

“Establishing SSL connection withoutserver's identity verification is not recommended. According to MySQL 5.5.45+,5.6.26+ and 5.7.6+ requirements SSL connection must be established by defaultif explicit option isn't set. For compliance with existing applications notusing SSL the verifyServerCertificate property is set to 'false'. You needeither to explicitly disable SSL by setting useSSL=false, or set useSSL=trueand provide truststore for server certificate verification.”

4、url中加上“serverTimezone=GMT%2B8”(GMT%2B8代表东八区)

或者直接修改数据库的默认时区:
show variables like '%time_zone%';set global time_zone='+8:00';
最后附示例URL:
jdbc:mysql://127.0.0.1:3306/test?useUnicode=true&characterEncoding=UTF-8&userSSL=false&serverTimezone=GMT%2B8

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • Spring Boot 参考指南 介绍 转载自:https://www.gitbook.com/book/qbgb...
    毛宇鹏阅读 47,010评论 6 342
  • Spring Cloud为开发人员提供了快速构建分布式系统中一些常见模式的工具(例如配置管理,服务发现,断路器,智...
    卡卡罗2017阅读 135,288评论 19 139
  • 树屋奇遇记 今天返校,拖着大箱子回到熟悉的宿舍,依旧是简洁明亮的上床下铺六人间。但这次回来,不但没有抱怨没有独卫没...
    阿萱啊啊七夕阅读 292评论 0 0
  • performSelector是一个很有用的函数,跟它打过不少交道,经过血与泪的教训,总结一下它的使用如下: 使用...
    SpursGo阅读 388评论 0 0
  • 1、impulsive If someone is impulsive, it means that they a...
    煜彬Steven阅读 431评论 0 0