WebWork2+Spring1+Hibernate3连接数据库出现问题

来源:百度知道 编辑:UC知道 时间:2024/06/15 22:12:01
程序使用了较老的WSH(WebWork2+Spring1+Hibernate3)的搭配框架,数据库使用了MySQL5,容器是Tomcat,在一台电脑上可正确运行,而转移到另一台上却不行了,报错如下,不知道为什么连接不上数据库?
恳请哪位高人指教下面错误解决方法:
org.springframework.transaction.CannotCreateTransactionException: Could not open Hibernate Session for transaction; nested exception is org.hibernate.exception.GenericJDBCException: Cannot open connection
org.hibernate.exception.GenericJDBCException: Cannot open connection
at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103)
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:29)
at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:420)
at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:144)
at org.hibernate.jdbc.J

这可能是你配置连接数据库部分的问题
1.打开application.xml文件,检查一下连接数据库的配置,数据库名,用户名,密码是否正确,
2.MySQL的JDBC的jar包是否引入了
3.总之,发生在了数据层,你就从spring到hibernate,JDBC的找,如果还没有就是数据库的问题了