错误原因

c3p0的配置错误

错误显示

"C:\Program Files\Java\jdk1.8.0_162\bin\java.exe" -ea -Didea.test.cyclic.buffer.size= "-javaagent:D:\Program\Software\IntelliJIDEA\IntelliJ IDEA 2018.2.5\lib\idea_rt.jar=7816:D:\Program\Software\IntelliJIDEA\IntelliJ IDEA 2018.2.5\bin" -Dfile.encoding=UTF- -classpath "D:\Program\Software\IntelliJIDEA\IntelliJ IDEA 2018.2.5\lib\idea_rt.jar;D:\Program\Software\IntelliJIDEA\IntelliJ IDEA 2018.2.5\plugins\junit\lib\junit-rt.jar;D:\Program\Software\IntelliJIDEA\IntelliJ IDEA 2018.2.5\plugins\junit\lib\junit5-rt.jar;C:\Users\Administrator\.m2\repository\org\junit\platform\junit-platform-launcher\1.4.0-M1\junit-platform-launcher-1.4.0-M1.jar;C:\Users\Administrator\.m2\repository\org\apiguardian\apiguardian-api\1.0.0\apiguardian-api-1.0.0.jar;C:\Users\Administrator\.m2\repository\org\junit\platform\junit-platform-engine\1.4.0-M1\junit-platform-engine-1.4.0-M1.jar;C:\Users\Administrator\.m2\repository\org\junit\platform\junit-platform-commons\1.4.0-M1\junit-platform-commons-1.4.0-M1.jar;C:\Users\Administrator\.m2\repository\org\opentest4j\opentest4j\1.1.1\opentest4j-1.1.1.jar;C:\Users\Administrator\.m2\repository\org\junit\jupiter\junit-jupiter-engine\5.4.0-M1\junit-jupiter-engine-5.4.0-M1.jar;C:\Users\Administrator\.m2\repository\org\junit\jupiter\junit-jupiter-api\5.4.0-M1\junit-jupiter-api-5.4.0-M1.jar;C:\Program Files\Java\jdk1.8.0_162\jre\lib\charsets.jar;C:\Program Files\Java\jdk1.8.0_162\jre\lib\deploy.jar;C:\Program Files\Java\jdk1.8.0_162\jre\lib\ext\access-bridge-64.jar;C:\Program Files\Java\jdk1.8.0_162\jre\lib\ext\cldrdata.jar;C:\Program Files\Java\jdk1.8.0_162\jre\lib\ext\dnsns.jar;C:\Program Files\Java\jdk1.8.0_162\jre\lib\ext\jaccess.jar;C:\Program Files\Java\jdk1.8.0_162\jre\lib\ext\jfxrt.jar;C:\Program Files\Java\jdk1.8.0_162\jre\lib\ext\localedata.jar;C:\Program Files\Java\jdk1.8.0_162\jre\lib\ext\nashorn.jar;C:\Program Files\Java\jdk1.8.0_162\jre\lib\ext\sunec.jar;C:\Program Files\Java\jdk1.8.0_162\jre\lib\ext\sunjce_provider.jar;C:\Program Files\Java\jdk1.8.0_162\jre\lib\ext\sunmscapi.jar;C:\Program Files\Java\jdk1.8.0_162\jre\lib\ext\sunpkcs11.jar;C:\Program Files\Java\jdk1.8.0_162\jre\lib\ext\zipfs.jar;C:\Program Files\Java\jdk1.8.0_162\jre\lib\javaws.jar;C:\Program Files\Java\jdk1.8.0_162\jre\lib\jce.jar;C:\Program Files\Java\jdk1.8.0_162\jre\lib\jfr.jar;C:\Program Files\Java\jdk1.8.0_162\jre\lib\jfxswt.jar;C:\Program Files\Java\jdk1.8.0_162\jre\lib\jsse.jar;C:\Program Files\Java\jdk1.8.0_162\jre\lib\management-agent.jar;C:\Program Files\Java\jdk1.8.0_162\jre\lib\plugin.jar;C:\Program Files\Java\jdk1.8.0_162\jre\lib\resources.jar;C:\Program Files\Java\jdk1.8.0_162\jre\lib\rt.jar;D:\Program\Exercise\JavaWeb_Text\MVC_Exercise\web\WEB-INF\classes;D:\Program\OperatingEnvironment\Tomcat\lib\jsp-api.jar;D:\Program\OperatingEnvironment\Tomcat\lib\servlet-api.jar;D:\Program\Exercise\JavaWeb_Text\MVC_Exercise\web\WEB-INF\lib\c3p0-0.9.5.2.jar;D:\Program\Exercise\JavaWeb_Text\MVC_Exercise\web\WEB-INF\lib\opentest4j-1.1.1.jar;D:\Program\Exercise\JavaWeb_Text\MVC_Exercise\web\WEB-INF\lib\commons-dbutils-1.7.jar;D:\Program\Exercise\JavaWeb_Text\MVC_Exercise\web\WEB-INF\lib\apiguardian-api-1.0.0.jar;D:\Program\Exercise\JavaWeb_Text\MVC_Exercise\web\WEB-INF\lib\junit-jupiter-api-5.4.0-M1.jar;D:\Program\Exercise\JavaWeb_Text\MVC_Exercise\web\WEB-INF\lib\mchange-commons-java-0.2.11.jar;D:\Program\Exercise\JavaWeb_Text\MVC_Exercise\web\WEB-INF\lib\junit-platform-commons-1.4.0-M1.jar;D:\Program\Exercise\JavaWeb_Text\MVC_Exercise\web\WEB-INF\lib\mysql-connector-java-5.1.40-bin.jar" com.intellij.rt.execution.junit.JUnitStarter -ideVersion5 -junit5 test.JdbcUtilsTest
十二月 , :: 下午 com.mchange.v2.log.MLog
信息: MLog clients using java 1.4+ standard logging.
十二月 , :: 下午 com.mchange.v2.c3p0.C3P0Registry
信息: Initializing c3p0-0.9.5.2 [built -December- :: -; debug? true; trace: ]
十二月 , :: 下午 com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource
信息: Initializing c3p0 pool... com.mchange.v2.c3p0.ComboPooledDataSource [ acquireIncrement -> , acquireRetryAttempts -> , acquireRetryDelay -> , autoCommitOnClose -> false, automaticTestTable -> null, breakAfterAcquireFailure -> false, checkoutTimeout -> , connectionCustomizerClassName -> null, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, contextClassLoaderSource -> caller, dataSourceName -> mvcApp, debugUnreturnedConnectionStackTraces -> false, description -> null, driverClass -> com.mysql.jdbc.Driver, extensions -> {}, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, forceSynchronousCheckins -> false, forceUseNamedDriverClass -> false, identityToken -> 1b60m599z1pxd3r21653zeu|9a7504c, idleConnectionTestPeriod -> , initialPoolSize -> , jdbcUrl -> jdbc:mysql://localhost:3306/homework_mvc?useSSL=false&useUnicode=true&characterEncoding=UTF-8, maxAdministrativeTaskTime -> 0, maxConnectionAge -> 0, maxIdleTime -> 0, maxIdleTimeExcessConnections -> 0, maxPoolSize -> 50, maxStatements -> 20, maxStatementsPerConnection -> 5, minPoolSize -> 1, numHelperThreads -> 3, preferredTestQuery -> null, privilegeSpawnedThreads -> false, properties -> {user=******, password=******}, propertyCycle -> 0, statementCacheNumDeferredCloseThreads -> 0, testConnectionOnCheckin -> false, testConnectionOnCheckout -> false, unreturnedConnectionTimeout -> 0, userOverrides -> {}, usesTraditionalReflectiveProxies -> false ]
十二月 , :: 下午 com.mchange.v2.resourcepool.BasicResourcePool
警告: com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@533ed475 -- Acquisition Attempt Failed!!! Clearing pending acquires. While trying to acquire a needed new resource, we failed to succeed more than the maximum number of allowed acquisition attempts (). Last acquisition attempt exception:
java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:)
at com.mysql.jdbc.MysqlIO.proceedHandshakeWithPluggableAuthentication(MysqlIO.java:)
at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:)
at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:)
at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:)
at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:)
at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:)
at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:)
at sun.reflect.GeneratedConstructorAccessor7.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:)
at java.lang.reflect.Constructor.newInstance(Constructor.java:)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:)
at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:)
at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:)
at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:)
at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:)
at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:)
at com.mchange.v2.resourcepool.BasicResourcePool.doAcquireAndDecrementPendingAcquiresWithinLockOnSuccess(BasicResourcePool.java:)
at com.mchange.v2.resourcepool.BasicResourcePool.access$(BasicResourcePool.java:)
at com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask.run(BasicResourcePool.java:)
at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:) 十二月 , :: 下午 com.mchange.v2.resourcepool.BasicResourcePool
警告: Having failed to acquire a resource, com.mchange.v2.resourcepool.BasicResourcePool@1176dcec is interrupting all Threads waiting on a resource to check out. Will try again in response to new client requests.
十二月 , :: 下午 com.mchange.v2.resourcepool.BasicResourcePool
警告: com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@315263a -- Acquisition Attempt Failed!!! Clearing pending acquires. While trying to acquire a needed new resource, we failed to succeed more than the maximum number of allowed acquisition attempts (). Last acquisition attempt exception:
java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:)
at com.mysql.jdbc.MysqlIO.proceedHandshakeWithPluggableAuthentication(MysqlIO.java:)
at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:)
at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:)
at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:)
at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:)
at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:)
at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:)
at sun.reflect.GeneratedConstructorAccessor7.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:)
at java.lang.reflect.Constructor.newInstance(Constructor.java:)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:)
at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:)
at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:)
at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:)
at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:)
at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:)
at com.mchange.v2.resourcepool.BasicResourcePool.doAcquireAndDecrementPendingAcquiresWithinLockOnSuccess(BasicResourcePool.java:)
at com.mchange.v2.resourcepool.BasicResourcePool.access$(BasicResourcePool.java:)
at com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask.run(BasicResourcePool.java:)
at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:) 十二月 , :: 下午 com.mchange.v2.resourcepool.BasicResourcePool
警告: Having failed to acquire a resource, com.mchange.v2.resourcepool.BasicResourcePool@1176dcec is interrupting all Threads waiting on a resource to check out. Will try again in response to new client requests. java.sql.SQLException: Connections could not be acquired from the underlying database! at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:)
at com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.getConnection(AbstractPoolBackedDataSource.java:)
at dbdemo.JdbcUtils.getConnection(JdbcUtils.java:)
at test.JdbcUtilsTest.getConnection(JdbcUtilsTest.java:)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:)
at java.lang.reflect.Method.invoke(Method.java:)
at org.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:)
at org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:)
at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeTestMethod$(TestMethodTestDescriptor.java:)
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:)
at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeTestMethod(TestMethodTestDescriptor.java:)
at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:)
at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$(NodeTestTask.java:)
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$(NodeTestTask.java:)
at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$(NodeTestTask.java:)
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:)
at java.util.ArrayList.forEach(ArrayList.java:)
at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$(NodeTestTask.java:)
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$(NodeTestTask.java:)
at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$(NodeTestTask.java:)
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:)
at java.util.ArrayList.forEach(ArrayList.java:)
at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$(NodeTestTask.java:)
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$(NodeTestTask.java:)
at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$(NodeTestTask.java:)
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:)
at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:)
at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:)
at org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:)
at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:)
at org.junit.platform.launcher.core.DefaultLauncher.lambda$execute$(DefaultLauncher.java:)
at org.junit.platform.launcher.core.DefaultLauncher.withInterceptedStreams(DefaultLauncher.java:)
at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:)
at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:)
at com.intellij.junit5.JUnit5IdeaTestRunner.startRunnerWithArgs(JUnit5IdeaTestRunner.java:)
at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:)
Caused by: com.mchange.v2.resourcepool.CannotAcquireResourceException: A ResourcePool could not acquire a resource from its primary factory or source.
at com.mchange.v2.resourcepool.BasicResourcePool.awaitAvailable(BasicResourcePool.java:)
at com.mchange.v2.resourcepool.BasicResourcePool.prelimCheckoutResource(BasicResourcePool.java:)
at com.mchange.v2.resourcepool.BasicResourcePool.checkoutResource(BasicResourcePool.java:)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutAndMarkConnectionInUse(C3P0PooledConnectionPool.java:)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:)
... more
Caused by: java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:)
at com.mysql.jdbc.MysqlIO.proceedHandshakeWithPluggableAuthentication(MysqlIO.java:)
at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:)
at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:)
at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:)
at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:)
at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:)
at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:)
at sun.reflect.GeneratedConstructorAccessor7.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:)
at java.lang.reflect.Constructor.newInstance(Constructor.java:)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:)
at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:)
at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:)
at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:)
at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:)
at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:)
at com.mchange.v2.resourcepool.BasicResourcePool.doAcquireAndDecrementPendingAcquiresWithinLockOnSuccess(BasicResourcePool.java:)
at com.mchange.v2.resourcepool.BasicResourcePool.access$(BasicResourcePool.java:)
at com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask.run(BasicResourcePool.java:)
at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:) 十二月 , :: 下午 com.mchange.v2.resourcepool.BasicResourcePool
警告: com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@a67e052 -- Acquisition Attempt Failed!!! Clearing pending acquires. While trying to acquire a needed new resource, we failed to succeed more than the maximum number of allowed acquisition attempts (). Last acquisition attempt exception:
java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:)
at com.mysql.jdbc.MysqlIO.proceedHandshakeWithPluggableAuthentication(MysqlIO.java:)
at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:)
at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:)
at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:)
at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:)
at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:)
at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:)
at sun.reflect.GeneratedConstructorAccessor7.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:)
at java.lang.reflect.Constructor.newInstance(Constructor.java:)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:)
at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:)
at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:)
at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:)
at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:)
at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:)
at com.mchange.v2.resourcepool.BasicResourcePool.doAcquireAndDecrementPendingAcquiresWithinLockOnSuccess(BasicResourcePool.java:)
at com.mchange.v2.resourcepool.BasicResourcePool.access$(BasicResourcePool.java:)
at com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask.run(BasicResourcePool.java:)
at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:) 十二月 , :: 下午 com.mchange.v2.resourcepool.BasicResourcePool
警告: Having failed to acquire a resource, com.mchange.v2.resourcepool.BasicResourcePool@1176dcec is interrupting all Threads waiting on a resource to check out. Will try again in response to new client requests. Process finished with exit code -

解决方法

仔细检查配置文档

配置文档

<?xml version="1.0" encoding="UTF-8"?>
<c3p0-config>
<named-config name="mvcApp"> 
<property name="user">root</property>
<property name="password">root</property>
<property name="driverClass">com.mysql.jdbc.Driver</property>
<property name="jdbcUrl">jdbc:mysql://localhost:3306/homework_mvc?useSSL=false&amp;useUnicode=true&amp;characterEncoding=UTF-8</property>
<!--以上的user是数据库的用户,
password是数据库的密码,
driverClass是mysql的数据库驱动,
jdbcUrl是连接数据库的url ;--> <!--当连接池中的连接耗尽的时候c3p0一次同时获取的连接数 -->
<property name="acquireIncrement"></property>
<!--初始化时获取十个连接,取值应在minPoolSize与maxPoolSize之间 -->
<property name="initialPoolSize"></property>
<!--连接池中保留的最小连接数 -->
<property name="minPoolSize"></property>
<!--连接池中保留的最大连接数 -->
<property name="maxPoolSize"></property>
<!--JDBC的标准参数,用以控制数据源内加载的PreparedStatements数量。但由于预缓存的statements属于单个connection而不是整个连接池。所以设置这个参数需要考虑到多方面的因素。如果maxStatements与maxStatementsPerConnection均为0,则缓存被关闭。Default: -->
<property name="maxStatements"></property> 
<!--maxStatementsPerConnection定义了连接池内单个连接所拥有的最大缓存statements数。Default: -->
<property name="maxStatementsPerConnection"></property>
</named-config>
</c3p0-config>

成功显示

JavaWeb:c3p0配置问题-----java.sql.SQLException: Connections could not be acquired from the underlying database!的更多相关文章

  1. 数据库连接问题之:Caused by: java.sql.SQLException: Connections could not be acquired from the underlying database!

    要么是驱动问题(没加载到工程中去或者其他问题)要么是账号密码或者url或者driver写错 driver:com.mysql.jdbc.Driver url:jdbc:mysql://localhos ...

  2. dea创建Maven工程用c3p0连接数据库报错java.sql.SQLException: Connections could not be acquired from the underlying

    idea   java.sql.SQLException: Connections could not be acquired from the underlying database! 转载自:ht ...

  3. 【JDBC 报错】Connections could not be acquired from the underlying database!

    项目启动报错: [2016-07-13 10:04:15,074] ERROR org.apache.ibatis.executor.BaseExecutor Could not get a data ...

  4. Connections could not be acquired from the underlying database!

    Connections could not be acquired from the underlying database! 报错截图: 报错内容: Exception in thread &quo ...

  5. c3p0:Connections could not be acquired from the underlying database!解决方案

    在利用ssh框架做网站的时候遇到了一个比较棘手的问题,一直连接不上数据库,问题描述如下: 各种百度然后说的最多的解决方案是: 1,驱动配置有误:2,数据库连接地址有误:3,密码或帐号有误: 4,数据库 ...

  6. Could not open JDBC Connection for transaction; nested exception is java.sql.SQLException: Connectio

    严重: StandardWrapper.Throwableorg.springframework.transaction.CannotCreateTransactionException: Could ...

  7. maven+springmvc出现:java.sql.SQLException: Unknown system variable 'query_cache_size'

    连接mysql时一直出现以下的错误: org.springframework.web.util.NestedServletException: Request processing failed; n ...

  8. Javaweb项目中出现java.sql.SQLException: The server time zone value '�й���׼ʱ��' is unrecognized or represents more than one time zone.异常

    javaweb项目中java.sql.SQLException: The server time zone value '�й���׼ʱ��' is unrecognized or represent ...

  9. JavaWeb报错:java.sql.SQLException: Invalid value for getInt()

    1.错误描述:在对数据库进行操作时,控制台报错:java.sql.SQLException: Invalid value for getInt() :2.错误原因:数据库中表的字段的类型与实体类中属性 ...

随机推荐

  1. Confluence 6 权限概述

    下面的权限可以指派给任何一个空间: 分类 权限 全部(All) 查看(View )给你能够查看空间内容的权限,包括有空间目录和其他的内容,例如主面板. 删除自己(Delete own) 给你权限删除你 ...

  2. php 中文字符串反转

    /** * * 中文字符串倒序 * @param str $str * return str **/ function str_en_desc($str){ $len=mb_strlen($str); ...

  3. TCP/UDP协议简要梳理

    TCP/UDP协议简要梳理 TCP TCP,Transmission Control Protocol,传输控制协议是一种面向连接的.可靠的.基于字节流的传输层通信协议.在因特网协议族中,TCP所在的 ...

  4. 『MXNet』第八弹_数据处理API_上

    一.Gluon数据加载 下面的两个dataset处理类一般会成对出现,两个都可做预处理,但是由于后面还可能用到原始图片,.ImageFolderDataset不加预处理的话可以满足,所以建议在.Dat ...

  5. csrf漏洞

    漏洞原理:csrf全名为跨站请求伪造,是一种对网站的恶意利用,虽然听起来和xss很像,但是它们俩还是有很大的区别的.csrf是通过伪造来自受信任用户的请求来利用受信任的网站. 比如: 一个有csrf漏 ...

  6. Leetcode 1005. K 次取反后最大化的数组和

    1005. K 次取反后最大化的数组和  显示英文描述 我的提交返回竞赛   用户通过次数377 用户尝试次数413 通过次数385 提交次数986 题目难度Easy 给定一个整数数组 A,我们只能用 ...

  7. 27. Remove Element C++移除元素

    网址:https://leetcode.com/problems/remove-element/ 双指针(广义) class Solution { public: int removeElement( ...

  8. Spring注解之@Retention

    作用是定义被它所注解的注解保留多久,一共有三种策略,定义在RetentionPolicy枚举中: package java.lang.annotation; /** * Annotation rete ...

  9. Python装饰器--decorator

    装饰器 装饰器实质是一个函数,其作用就是在不改动其它函数代码的情况下,增加一些功能.如果我们需要打印函数调用前后日志,可以这么做 def log(func): print('%s is running ...

  10. 1.Liunx 文件管理

    文件管理命令 1.基本命令:ls .cd .pwd .man 2.文件操作:touch . cp . rm . mv .ln . mkdir . rmdir 3.文件查看:cat .more .les ...