在用Struts+Spring+Hibernate时遇到一直出现这个问题,求解决
typeExceptionreportmessageorg.springframework.transaction.CannotCreateTransactionExce...
typeException report
messageorg.springframework.transaction.CannotCreateTransactionException: Could not
open Hibernate Session for transaction; nested exception is
org.hibernate.exception.GenericJDBCException: Cannot open connection
descriptionThe server encountered an internal error that prevented
it from fulfilling this request.
exceptionjavax.servlet.ServletException: org.springframework.transaction.CannotCreateTransactionException: Could not open Hibernate Session for transaction; nested exception is org.hibernate.exception.GenericJDBCException: Cannot open connection
org.apache.struts.action.RequestProcessor.processException(RequestProcessor.java:535)
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:433)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
com.jwy.tools.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:31) 展开
messageorg.springframework.transaction.CannotCreateTransactionException: Could not
open Hibernate Session for transaction; nested exception is
org.hibernate.exception.GenericJDBCException: Cannot open connection
descriptionThe server encountered an internal error that prevented
it from fulfilling this request.
exceptionjavax.servlet.ServletException: org.springframework.transaction.CannotCreateTransactionException: Could not open Hibernate Session for transaction; nested exception is org.hibernate.exception.GenericJDBCException: Cannot open connection
org.apache.struts.action.RequestProcessor.processException(RequestProcessor.java:535)
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:433)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
com.jwy.tools.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:31) 展开
2013-05-01
展开全部
数据库连接错误,看是不是hibernate配饰数据库用户/密码那之类不正确,再就是看看数据库服务是不是没起开
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
你的spring的属性文件配置错误了, 主要是 数据管理器配置错误 导致数据连接初始化失败
你这个错误 启动tomcat就会报错
你这个错误 启动tomcat就会报错
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
错误为不能为事物打开hibernate会话、不能打开连接;向这两个方向去找问题;涉及到这两个方面的代码和配置文件;确定了范围,锻炼自己解决问题的能力
追问
代码是书上给的,没做任何改变啊
追答
尽然这样,就好好宏观地检查一下吧!另外,书,也不一定都是正确的,需要检验
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
spring 中的session 没有打开
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
数据库连接有问题吧
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询