码迷,mamicode.com
首页 > 其他好文 > 详细

搭建SSH入过的那些坑

时间:2016-05-17 11:13:11      阅读:125      评论:0      收藏:0      [点我收藏+]

标签:

添加完相关jar包,写完配置文件,写完测试类,运行提示

WARN:Establishing SSL connection without server‘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 default if explicit option isn‘t set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to ‘false‘. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification

这个是因为jdbcurl配置要改为

jdbcUrl=jdbc:mysql://localhost:3306/gss?useUnicode=true&characterEncoding=utf8&useSSL=true

继续运行报如下错误:

org.hibernate.exception.GenericJDBCException: Cannot open connection
Caused by: java.sql.SQLException: Connections could not be acquired from the underlying database!

Caused by: com.mchange.v2.resourcepool.CannotAcquireResourceException: A ResourcePool could not acquire a resource from its primary factory or source.

网上大多解决方案都是检查数据库连接 驱动 用户名 密码是否正确 附上我的配置:

jdbcUrl=jdbc:mysql://localhost:3306/gss?useUnicode=true&characterEncoding=utf8&useSSL=true
driverClass=com.mysql.jdbc.Driver
user=root
password=root
initialPoolSize=10
maxPoolSize=30    

依然报上面的错误,N Hours后发现是mysql驱动jar包问题,用的6.0.2,换成5.1.32就可以了

    <dependency>
      <groupId>mysql</groupId>
      <artifactId>mysql-connector-java</artifactId>
      <version>5.1.32</version>
    </dependency>

解决Failed to load class "org.slf4j.impl.StaticLoggerBinder"

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". 
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details. 
官网上刊登的解决办法是: 
      This error is reported when the org.slf4j.impl.StaticLoggerBinder class could not be loaded into memory. This happens when no appropriate SLF4J binding could be found on the class path. Placing one (and only one) of slf4j-nop.jar, slf4j-simple.jar, slf4j-log4j12.jar, slf4j-jdk14.jar or logback-classic.jar on the class path should solve the problem.
其实就是添加一个叫做slf4j-log4j12-1.5.11.jar的包进行转换就可以了,注意版本号。

搭建SSH入过的那些坑

标签:

原文地址:http://www.cnblogs.com/God-/p/5500701.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!