搭建SSH入过的那些坑

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了搭建SSH入过的那些坑相关的知识,希望对你有一定的参考价值。

添加完相关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入过的那些坑的主要内容,如果未能解决你的问题,请参考以下文章

Hadoop集群-集群搭建踩的那些坑之ssh篇

Hadoop集群-集群搭建踩的那些坑之ssh篇

git 使用过的那些坑

Hadoop集群-集群搭建踩的那些坑之hadoop篇

Hadoop集群-集群搭建踩的那些坑之hadoop篇

关于hyperledger,那些年我蹚过的那些坑……