搭建SSH入过的那些坑
1、添加完相关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
2、继续运行报如下错误:
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
3、依然报上面的错误,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>
4、解决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.
5、 Intellij配置完xml后找不到xml,但是按CTRL又能点击过去
ERROR [RMI TCP Connection(3)-127.0.0.1] ContextLoader:351 - Context initialization failed org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Failed to import bean definitions from relative location [cn/god/nsfw/user/conf/user-spring.xml] Offending resource: class path resource [applicationContext.xml]; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from URL [file:/D:/javaCode/projects/tax/target/god/WEB-INF/classes/cn/god/nsfw/user/conf/user-spring.xml]; nested exception is java.io.FileNotFoundException: D:\javaCode\projects\tax\target\god\WEB-INF\classes\cn\god\nsfw\user\conf\user-spring.xml (系统找不到指定的路径。)
这个需要把xml所在文件夹设置成Resource就可以了。
6、测试hibernate自动建表,报错
Hibernate: insert into news_table (title, content) values (?, ?)
Exception in thread "main" org.hibernate.exception.SQLGrammarException: could not insert: [org.crazyit.app.domain.News]
…………此处省略
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'hibernate.news_table' doesn't exist
…………此处省略
<property name="hibernate.dialect">org.hibernate.dialect.MySQL5Dialect</property>
把这行换成:
<property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
但是不知道为什么。。。。。
搭建SSH入过的那些坑的更多相关文章
- 在windows上搭建SSH服务踩过的坑
前两天安装了windows操作系统,想在windows上做内网穿透,所以就想在windows下启用ssh服务,今天就来讲一下我在搭建ssh服务中遇到的坑. 我显示在Mac下搭建了ssh服务,并且测试通 ...
- Linux搭建SSH服务器
Linux 远程登录服务:ssh ·SSH是标准的网络协议,可用于大多数UNIX操作系统,能够实现字符界面的远程登录管理,它默认使用22号端口,采用密文的形式在网络中传输数据,相对于通过明文传输的Te ...
- 搭建SSH环境之添加所需jar包
一.首先介绍要添加框架环境: JUnit Struts2 Hibernate Spring (1)配置JUnit /**-------------------------添加JUnit-------- ...
- 搭建SSH
搭建SSH详细步骤及相关说明 因为手里已有相关jar,为方便我搭建的是:Struts2.0+Hibernate3.3+Spring3.0,数据库:MySQL 如果想搭建最新的,在官网上下载最新ja ...
- Mac下maven工程的创建,并搭建SSH环境
最近项目有用到maven,就特地学了一下.maven的一句话攻略就是,项目托管.帮你解决各种项目琐事:清理,导包....等等. 首先先到apach官网去下载一个maven的包,http://maven ...
- Eclipse搭建SSH(Struts2+Spring+Hibernate)框架教程
| 版权声明:本文为博主原创文章,未经博主允许不得转载. 前言 确实,刚创博客,对于这个陌生的东西还是有些许淡然.这是我的第一篇博文,希望能给你们有帮助,这就是我最大的乐趣! 好了下面进入正题: SS ...
- 用eclipse搭建SSH(struts+spring+hibernate)框架
声明: 本文是个人对ssh框架的学习.理解而编辑出来的,可能有不足之处,请大家谅解,但希望能帮助到大家,一起探讨,一起学习! Struts + Spring + Hibernate三者各自的特点都是什 ...
- myeclipse搭建SSH框架
搭建SSH框架 Struts+hibernater+spring架构(myeclipse) 右击,首先加入spring,加入hibernater,再加入struts2 复制jar包(把tomcat发布 ...
- MyEclipse8.5快速搭建SSH框架
来源于:http://jingyan.baidu.com/article/a378c960a78125b3282830cc.html MyEclipse8.5快速搭建SSH框架 使用版本: Strut ...
随机推荐
- css改变背景透明度【转】
兼容主流浏览器的CSS透明代码: .transparent_class { filter:alpha(opacity=50); -moz-opacity:0.5; -khtml-opacity: 0. ...
- 主线程中创建不同的handler实例,接收消息会不会冲突
http://www.cnblogs.com/transmuse/archive/2011/05/16/2048073.html这篇博文讲的比较透彻,可参考. 当然结论是不会冲突.因为每个messag ...
- python中时间的基本使用
格式化日期 我们可以使用 time 模块的 strftime 方法来格式化日期,: time.strftime(format[, t]) #!/usr/bin/python # -*- coding: ...
- React.js入门小案例
<!DOCTYPE html> <html> <head> <meta charset="UTF-8" /> <title&g ...
- 求两个数的最大公约数(Java)
获得两个随机数(100以内),并放入数组中 public int[] getTwoRandom(){ int[] t = new int[2]; Random rand = new Random(); ...
- Google Analytics Premium VS Adobe Analytics
在很久以前的互联网年代,Google收购了一家名为Urchin的公司,进而演化诞生了Google Analytics.当Goochin(Google / Urchin)首次亮相时,它被所有人称为“新的 ...
- windows下wordpress环境快速搭建
所需要软件下载网址:https://bitnami.com/ 安装使用说明网址:http://www.websoft9.com/wp-content/plugins/documente/documen ...
- 如何使用不同参数组合生成独立的TestCase函数(Python)
在使用selenium2 Python做自动化测试的时候遇到个问题,写一个testcase 生成报告后,会有一个case的执行状态记录.这样我们写一个登录功能的自动化用例,只写一个case显然是不行的 ...
- 2016CCPC东北地区大学生程序设计竞赛 1005 HDU5926
链接http://acm.hdu.edu.cn/showproblem.php?pid=5926 题意:给我们一个矩阵,问你根据连连看的玩法可以消去其中的元素 解法:连连看怎么玩,就怎么写,别忘记边界 ...
- anroid打包
http://blog.csdn.net/qq435757399/article/details/46634363 转载 Gradle打包APP签名 默认情况下,debug被配置成使用一个debug ...