搭建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 ...
随机推荐
- html 关于块级元素和行内元素
常用的行内元素要记住:a.span.img.input.lable.select.strong.textarea 常用的块级元素要记住:div.h1~h6.dl.ul.ol 例如在一个title中,有 ...
- mysql 利用binlog增量备份,还原实例
mysql 利用binlog增量备份,还原实例 张映 发表于 2010-09-29 分类目录: mysql 标签:binlog, mysql, mysqldump, 增量备份 一,什么是增量备份 增量 ...
- test if DEMO
可参考:http://blog.chinaunix.net/uid-20671208-id-3643362.html 1.test 举例: test -d ~/auto && echo ...
- restful 注解
@Path @Path 注释被用来描述根资源.子资源方法或子资源的位置.value 值可以包含文本字符.变量或具有定制正则表达式的变量. @GET.@POST.@PUT.@DELETE.@HEAD @ ...
- 关于ADO.NET@SQL Server&SqlDataReader
先说基础的,说基础的明白了再深的也是一样的.SQL是关系型数据库,所以就决定了对其操作的时候ADO的一些类要相互联系,Connection 类Command对象(ExecuteReader()方法.E ...
- HDU 3076:ssworld VS DDD(概率DP)
http://acm.split.hdu.edu.cn/showproblem.php?pid=3076 ssworld VS DDD Problem Description One day, s ...
- two day python基础知识
1.调用功能 ---- -在同一个目录下,调用用户名密码登陆模块 2.创建文件夹 import os #os模块 os.mkdir ("new_dd3")# 创建文件夹 三元 3. ...
- android应用程序中获取view 的位置
1. 相对位置: getLeft() , getRight(), getTop(), getBottom() 在Android中可以把left相当于X轴值, top相当于Y轴值, 通过这两个值Andr ...
- c#之线程随机
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; usin ...
- Cookie案例
实现的功能是:在页面上点击,各种书名,跳转到另一个页面,在点解return 回到原来的页面,并且最下面出现刚才点击的书名:进行多次操作,都会出现刚刚点击的书名: 类似于:在浏览器上显示你登录的记录: ...