Could not open Hibernate Session for transaction

异常信息如下:
org.apache.jasper.JasperException: Could not open Hibernate Session for transaction; nested exception is org.hibernate.exception.GenericJDBCException: Cannot open connection 
  org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:372) 
  org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292) 
  org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236) 
  javax.servlet.http.HttpServlet.service(HttpServlet.java:802) 
  org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:174) 
  org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) 
  org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:75) 
  org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) 
  
  
  root cause 
  
  org.springframework.transaction.CannotCreateTransactionException: Could not open Hibernate Session for transaction; nested exception is org.hibernate.exception.GenericJDBCException: Cannot open connection 
  org.springframework.orm.hibernate3.HibernateTransactionManager.doBegin(HibernateTransactionManager.java:548) 
  org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:282) 
  org.springframework.transaction.interceptor.TransactionAspectSupport.createTransactionIfNecessary(TransactionAspectSupport.java:225) 
  org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:89) 
  org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170) 
  org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:176) 
  $Proxy8.getRecommendationEquipList(Unknown Source) 
  org.apache.jsp.xjtuequipment.index_jsp._jspService(index_jsp.java:138) 
  org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94) 
  javax.servlet.http.HttpServlet.service(HttpServlet.java:802) 
  org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324) 
  org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292) 
  org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236) 
  javax.servlet.http.HttpServlet.service(HttpServlet.java:802) 
  org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:174) 
  org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) 
  org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:75) 
  org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) 
  


可能的原因:
1.数据库连接问题
2.服务器没开
3.数据库连接端口被屏蔽
4.连接部分代码错误等原因。


转载自:
http://www.myexception.cn/java%20exception/96.html

你可能感兴趣的:(java,apache,Hibernate,Web,servlet)