【MyBatis - maven项目 - 调用代理Dao中的方法时-执行错误;】
{1}
org.apache.ibatis.exceptions.PersistenceException:
### Error querying database.
Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException:
Client does not support authentication protocol requested by server; consider upgrading MySQL client
### Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException:
Client does not support authentication protocol requested by server; consider upgrading MySQL client
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException:
Client does not support authentication protocol requested by server; consider upgrading MySQL client
原因:MySQL数据库版本位 8.0 - 数据库驱动位 5.多,这个驱动不行了
解决:pom.xml中重新设置 MySQL驱动版本8.多,
{2}
Loading class `com.mysql.jdbc.Driver‘. This is deprecated.
The new driver class is `com.mysql.cj.jdbc.Driver‘.
The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.
原因:`com.mysql.jdbc.Driver‘过时了,用com.mysql.cj.jdbc.Driver;
{3}
org.apache.ibatis.exceptions.PersistenceException:
### Error querying database.
Cause: java.sql.SQLException:
The server time zone value ‘Öйú±ê׼ʱ¼ä‘ is unrecognized or represents more than one time zone.
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.
### Cause:
java.sql.SQLException:
The server time zone value ‘Öйú±ê׼ʱ¼ä‘ is unrecognized or represents more than one time zone.
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.
Caused by:
java.sql.SQLException:
The server time zone value ‘Öйú±ê׼ʱ¼ä‘ is unrecognized or represents more than one time zone.
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.
Caused by:
com.mysql.cj.exceptions.InvalidConnectionAttributeException:
The server time zone value ‘Öйú±ê׼ʱ¼ä‘ is unrecognized or represents more than one time zone.
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.
原因分析:
根据报错我们知道这是时间报错,
没有指定明确的时区,
是因为新版的mysql会询问是否SSL连接,返回一个Boolean值,我们需要手动指定true或者false。
所以再次更改配置文件中的 url 满足其要求即可,如下:
jdbc:mysql://localhost:3306/mybatis?characterEncoding=utf-8&serverTimezone=UTC&useSSL=false"
jdbc:mysql://localhost:3306/mybatis?serverTimezone=UTC&useSSL=false --会有问题 & 后加[amp]???为啥?
【web.xml - maven项目 - 调用代理Dao中的方法时-执行错误;】
报错:Multiple annotations found at this line:
可能:有的地方多了空格,或者多了标点;
原文:https://www.cnblogs.com/floakss/p/12639470.html