【知识整理】nested exceptionis org.hibernate.exception.GenericJDBCException: Cannot open connection。
来源:互联网 发布:nginx rtmp 点播配置 编辑:程序博客网 时间:2024/06/13 11:50
一。本人将公司基于SSH(Spring,SpringMVC,Hibernate)的web项目上传至远程服务器,打开网页后报500错误。查看日志文件,发现后台抛出了如下异常:nested exceptionis org.hibernate.exception.GenericJDBCException: Cannot open connection。翻译过来大意是说,在使用Hibernate通过JDBC访问数据库时产生异常,无法连接到数据库。异常如下图:
二。项目在本地服务器测试没任何问题,上传至远程服务器就抛这样的异常,这个问题困扰了我一天,在网上查找各种资料最终找到了解决办法。给出的解决办法如下,供各位同仁参考。
抛出异常时连接数据库的配置文件如下:
(1)如何获取Ip地址?
取到域名,例如:www.baidu.com,点击开始->键盘按下cmd->在弹出的dos窗口输入ping www.baidu.com,获取到IP地址,替换配置文件中的域名即可。
(2)把连接数据库的url(jdbc.url)由域名ping成IP地址替换上去,完美解决。
阅读全文
1 0
- 【知识整理】nested exceptionis org.hibernate.exception.GenericJDBCException: Cannot open connection。
- nested exception is org.hibernate.exception.GenericJDBCException: Cannot open connection
- org.hibernate.exception.GenericJDBCException: Cannot open connection
- org.hibernate.exception.GenericJDBCException: Cannot open connection
- org.hibernate.exception.GenericJDBCException: Cannot open connection
- org.hibernate.exception.GenericJDBCException: Cannot open connection
- org.hibernate.exception.GenericJDBCException: Cannot open connection
- org.hibernate.exception.GenericJDBCException: Cannot open connection
- org.hibernate.exception.GenericJDBCException: Cannot open connection
- org.hibernate.exception.GenericJDBCException: Cannot open connection
- org.hibernate.exception.GenericJDBCException: Cannot open connection
- 解决 org.hibernate.exception.GenericJDBCException: Cannot open connection
- org.hibernate.exception.GenericJDBCException: Cannot open connection 处理方法
- org.hibernate.exception.GenericJDBCException: Cannot release connection
- org.hibernate.exception.GenericJDBCException: Cannot release connection
- org.hibernate.exception.GenericJDBCException: Cannot release connection
- 大数据查询时出现 org.hibernate.exception.GenericJDBCException: Cannot open connection 请求支援
- org.hibernate.exception.GenericJDBCException: Could not open connection
- android之bitmap处理图片
- Android源码剖析之Framework层实战版
- C#调用C++写的代码(VS2015)
- unity学习之飞机大战制作 关键点(二)定义层级,以及设置主角动画
- 医学图像处理---数据重新切分
- 【知识整理】nested exceptionis org.hibernate.exception.GenericJDBCException: Cannot open connection。
- Android 你应该知道的学习资源 进阶之路贵在坚持
- Git 使用(1)安装
- JDBC基础教程之CallableStatement
- windows系统下绿色版tomcat加内存方法(32位操作系统与64位操作系统)
- hibernate防止sql注入对参数赋值传参数的例子
- for your security, some settings are controlled by your system administrator (windows 10)
- HDU--1008--Elevator
- [bzoj4779][Usaco2010 Hol]Cowwar 奶牛战争 最大流