1. Error description
Org.hibernate.exception.GenericJDBCException:Could not open Connectionat Org.hibernate.exception.internal.StandardSQLExceptionConverter.convert (standardsqlexceptionconverter.java:54) At Org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert (sqlexceptionhelper.java:126) at Org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert (sqlexceptionhelper.java:112) at Org.hibernate.engine.jdbc.internal.LogicalConnectionImpl.obtainConnection (logicalconnectionimpl.java:235) at Org.hibernate.engine.jdbc.internal.LogicalConnectionImpl.getConnection (logicalconnectionimpl.java:171) at Org.hibernate.engine.transaction.internal.jdbc.JdbcTransaction.doBegin (jdbctransaction.java:67) at Org.hibernate.engine.transaction.spi.AbstractTransactionImpl.begin (abstracttransactionimpl.java:162) at Org.hibernate.internal.SessionImpl.beginTransaction (sessionimpl.java:1435) at Com.yhd.common.dao.impl.BaseDaoImpl.getSession (basedaoimpl.java:101) at Com.yhd.common.dao.impl.BaseDaoImpl.executeQuery (basedaoimpl.java:72) at COM.Yhd.dao.impl.StudentDaoImpl.findAllStu (studentdaoimpl.java:61) at Com.yhd.test.dao.StudentDaoTest.testFindAllStu (studentdaotest.java:70) at Sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) at Sun.reflect.NativeMethodAccessorImpl.invoke (nativemethodaccessorimpl.java:57) at Sun.reflect.DelegatingMethodAccessorImpl.invoke (delegatingmethodaccessorimpl.java:43) at Java.lang.reflect.Method.invoke (method.java:606) at Org.junit.runners.model.frameworkmethod$1.runreflectivecall ( FRAMEWORKMETHOD.JAVA:50) at Org.junit.internal.runners.model.ReflectiveCallable.run (reflectivecallable.java:12) At org.junit.runners.model.FrameworkMethod.invokeExplosively (frameworkmethod.java:47) at Org.junit.internal.runners.statements.InvokeMethod.evaluate (invokemethod.java:17) at Org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate ( RUNBEFORETESTMETHODCALLBACKS.JAVA:72) at Org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate (Runaftertestmethodcallbacks.java:81) at Org.springframework.test.context.junit4.statements.SpringRepeat.evaluate (springrepeat.java:72) At Org.junit.runners.ParentRunner.runLeaf (parentrunner.java:325) at Org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild (springjunit4classrunner.java:216) at Org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild (springjunit4classrunner.java:82) at Org.junit.runners.parentrunner$3.run (parentrunner.java:290) at Org.junit.runners.parentrunner$1.schedule ( parentrunner.java:71) at Org.junit.runners.ParentRunner.runChildren (parentrunner.java:288) at org.junit.runners.parentrunner.access$000 (parentrunner.java:58) at Org.junit.runners.parentrunner$2.evaluate ( parentrunner.java:268) at Org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate ( RUNBEFORETESTCLASSCALLBACKS.JAVA:60) at Org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate ( runaftertestclasscallbacks.java:67) at Org.junit.runners.ParentRunner.run (parentrunner.java:363) at Org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run ( springjunit4classrunner.java:162) at Org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run ( JUNIT4TESTREFERENCE.JAVA:50) at Org.eclipse.jdt.internal.junit.runner.TestExecution.run (testexecution.java:38) at Org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests (remotetestrunner.java:467) at Org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests (remotetestrunner.java:683) at Org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run (remotetestrunner.java:390) at Org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main (remotetestrunner.java:197) caused by: Java.sql.SQLException:Access denied for the user ' sa ' @ ' localhost ' (using Password:yes) at Com.mysql.jdbc.SQLError.createSQLException (sqlerror.java:996) at Com.mysql.jdbc.MysqlIO.checkErrorPacket ( mysqlio.java:3887) at Com.mysql.jdbc.MysqlIO.checkErrorPacket (mysqlio.java:3823) at Com.mysql.jdbc.MysqlIO.checkErrorPacket (Mysqlio.java:870) at Com.mysql.jdbc.MysqlIO.proceedHandshakeWithPluggableAuthentication (mysqlio.java:1659) at Com.mysql.jdbc.MysqlIO.doHandshake (mysqlio.java:1206) at Com.mysql.jdbc.ConnectionImpl.coreConnect ( connectionimpl.java:2234) at Com.mysql.jdbc.ConnectionImpl.connectOneTryOnly (connectionimpl.java:2265) at Com.mysql.jdbc.ConnectionImpl.createNewIO (connectionimpl.java:2064) at Com.mysql.jdbc.connectionimpl.<init > (connectionimpl.java:790) at com.mysql.jdbc.jdbc4connection.<init> (jdbc4connection.java:44) at Sun.reflect.NativeConstructorAccessorImpl.newInstance0 (Native Method) at Sun.reflect.NativeConstructorAccessorImpl.newInstance (nativeconstructoraccessorimpl.java:57) at Sun.reflect.DelegatingConstructorAccessorImpl.newInstance (delegatingconstructoraccessorimpl.java:45) at Java.lang.reflect.Constructor.newInstance (constructor.java:526) at Com.mysql.jdbc.Util.handleNewInstance ( util.java:377) at Com.mysql.jdbc.ConnectionImpl.getInstance (connectionimpl.java:395) at Com.mysql.jdbc.NonReGisteringdriver.connect (nonregisteringdriver.java:325) at Com.mchange.v2.c3p0.DriverManagerDataSource.getConnection (drivermanagerdatasource.java:146) at Com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection (Wrapperconnectionpooldatasource.java : 195) at Com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection ( wrapperconnectionpooldatasource.java:184) at Com.mchange.v2.c3p0.impl.C3P0PooledConnectionPoolManager.ensureFirstConnectionAcquisition ( c3p0pooledconnectionpoolmanager.java:971) at Com.mchange.v2.c3p0.impl.C3P0PooledConnectionPoolManager.createPooledConnectionPool ( c3p0pooledconnectionpoolmanager.java:858) at Com.mchange.v2.c3p0.impl.C3P0PooledConnectionPoolManager.getPool ( c3p0pooledconnectionpoolmanager.java:331) at Com.mchange.v2.c3p0.impl.C3P0PooledConnectionPoolManager.getPool ( c3p0pooledconnectionpoolmanager.java:323) at Com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.getConnection (abstractpoolbackeddatasource.java:146) at org.hibernate.engine.jdbc.coNnections.internal.DatasourceConnectionProviderImpl.getConnection (datasourceconnectionproviderimpl.java:139) at Org.hibernate.internal.abstractsessionimpl$noncontextualjdbcconnectionaccess.obtainconnection ( abstractsessionimpl.java:380) at Org.hibernate.engine.jdbc.internal.LogicalConnectionImpl.obtainConnection ( logicalconnectionimpl.java:228) ... Panax Notoginseng More
2. Cause of error
3. Solutions
Org.hibernate.exception.GenericJDBCException:Could Not open connection