错误原因

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. 数据库SQLserver(课本)

    一.SQL server的部署 1.数据库的基本概念 数据库通常是一个由行和列组成的二维表 数据表中的行通常叫做记录或元祖 数据表中的列通常叫做字段或属性 2.主键和外键 主键:定义主键可以保证数据的 ...

  2. css之transform属性

    定义元素的旋转(rotate),缩放(scale),移动(translate),倾斜(skew) rotate rotate(angle) 定义 2D 旋转,在参数中规定角度. rotate3d(x, ...

  3. python基础之 反射,md5加密 以及isinstance, type, issubclass内置方法的运用

    内容梗概: 1. isinstance, type, issubclass 2. 区分函数和方法 3. 反射(重点) 4. md5加密 1. isinstance, type, issubclass1 ...

  4. 21. Merge Two Sorted Lists (Java 合并有序链表 空间复杂度O(1))

    题目: Merge two sorted linked lists and return it as a new list. The new list should be made by splici ...

  5. c 语言连续输入字符型数据

    #include<stdio.h> #include<stdlib.h> void Input1(char* &str){ // /* 这种情况下想要逐个输入字符串数组 ...

  6. arguments.callee用法

    arguments.callee 在哪一个函数中运行,它就代表哪一个函数. 一般用在匿名函数中. 在匿名函数中有时会需要自己调用自己,但是由于是匿名函数,没有名子,无名可调. 这时就可以用argume ...

  7. oracle having sum group by 详解

    Aggregate functions (like SUM) often need an added GROUP BY functionality. 集合函数(类似SUM)经常需要用GROUP BY来 ...

  8. MySQL共享表空间概念

    1.表空间概念 Innodb存储引擎可将所有数据存放于ibdata*的共享表空间,也可将每张表存放于独立的.ibd文件的独立表空间.共享表空间以及独立表空间都是针对数据的存储方式而言的. 共享表空间 ...

  9. Oracle 11g后台进程一览表

    Background Processes Table F-1 describes Oracle Database background processes. In this context, a ba ...

  10. 青蛙跳N阶(变态跳)

    https://www.nowcoder.com/questionTerminal/22243d016f6b47f2a6928b4313c85387 描述 一只青蛙一次可以跳上1级台阶,也可以跳上2级 ...