HTTP Status 500 - --------------------------------------------------------------------------------type Exception reportmessage description The server encountered an internal error () that prevented it from fulfilling this request.exception org.springframework.dao.DataAccessResourceFailureException: could not execute query; nested exception is org.hibernate.exception.JDBCConnectionException: could not execute query
org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:610)
org.springframework.orm.hibernate3.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:412)
org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:378)
org.springframework.orm.hibernate3.HibernateTemplate.find(HibernateTemplate.java:847)
org.springframework.orm.hibernate3.HibernateTemplate.find(HibernateTemplate.java:839)
com.database.GenericDaoImpl.findALL(GenericDaoImpl.java:46)
com.service.UserServiceImpl.findAll(UserServiceImpl.java:42)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:597)
org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:301)
org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
org.springframework.aop.framework.adapter.MethodBeforeAdviceInterceptor.invoke(MethodBeforeAdviceInterceptor.java:50)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)

解决方案 »

  1.   

    is org.hibernate.exception.JDBCConnectionException: could not execute query我觉得是hql语句写错了。。把代码和语句贴出来一下噜。。
      

  2.   

    public List findALL() {
    // System.out.println("----------------"+this.getPersistClass().getName());
    return this.getHibernateTemplate().find("from "+this.getPersistClass().getName());
    }
      

  3.   

    System.out.println("----------------"+this.getPersistClass().getName());出来的是你的实体类吗 ?
    应该是这样才行:
    比如你的实体类名为 SysEntity
    return this.getHibernateTemplate().find("from "+ SysEntity.class.getName() ) ;
      

  4.   

    把每天第一次执行的SQL 弄出来。。
      

  5.   

    你用的什么数据库,Mysql有时候你长时间不用它会自动死掉的,所以你每次访问第一次会报错
      

  6.   


    我用的就是Mysql,遇到这种问题该怎么处理呢,有什么好的办法,请教一下。谢谢