Dao单元测试报错,改了改报错Failed to load ApplicationContext,然后重新导入后又是该错误
来源:2-8 升级mysql驱动相关的配置以支持mysql8
慕函数8175591
2023-03-23
2023-03-23 01:28:39.353 [main] INFO o.s.t.c.support.DefaultTestContextBootstrapper - Loaded default TestExecutionListener class names from location [META-INF/spring.factories]: [org.springframework.test.context.web.ServletTestExecutionListener, org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener, org.springframework.test.context.support.DependencyInjectionTestExecutionListener, org.springframework.test.context.support.DirtiesContextTestExecutionListener, org.springframework.test.context.transaction.TransactionalTestExecutionListener, org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener]
2023-03-23 01:28:39.402 [main] INFO o.s.t.c.support.DefaultTestContextBootstrapper - Using TestExecutionListeners: [org.springframework.test.context.web.ServletTestExecutionListener@5c18298f, org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener@31f924f5, org.springframework.test.context.support.DependencyInjectionTestExecutionListener@5579bb86, org.springframework.test.context.support.DirtiesContextTestExecutionListener@5204062d, org.springframework.test.context.transaction.TransactionalTestExecutionListener@4fcd19b3, org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener@376b4233]
2023-03-23 01:28:41.061 [MLog-Init-Reporter] INFO com.mchange.v2.log.MLog - MLog clients using slf4j logging.
2023-03-23 01:28:41.295 [main] INFO com.mchange.v2.c3p0.C3P0Registry - Initializing c3p0-0.9.5.4 [built 23-March-2019 23:00:48 -0700; debug? true; trace: 10]
2023-03-23 01:28:41.568 [main] INFO c.m.v2.c3p0.impl.AbstractPoolBackedDataSource - Initializing c3p0 pool… com.mchange.v2.c3p0.ComboPooledDataSource [ acquireIncrement -> 3, acquireRetryAttempts -> 2, acquireRetryDelay -> 1000, autoCommitOnClose -> false, automaticTestTable -> null, breakAfterAcquireFailure -> false, checkoutTimeout -> 10000, connectionCustomizerClassName -> null, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, contextClassLoaderSource -> caller, dataSourceName -> z8kfltav2vjgkc9rfbsi|710c2b53, debugUnreturnedConnectionStackTraces -> false, description -> null, driverClass -> com.mysql.cj.jdbc.Driver, extensions -> {}, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, forceSynchronousCheckins -> false, forceUseNamedDriverClass -> false, identityToken -> z8kfltav2vjgkc9rfbsi|710c2b53, idleConnectionTestPeriod -> 0, initialPoolSize -> 10, jdbcUrl -> jdbc:mysql://106.13.78.180:3306/o2o?useUnicode=true&characterEncoding=utf8&serverTimezone=UTC, maxAdministrativeTaskTime -> 0, maxConnectionAge -> 0, maxIdleTime -> 0, maxIdleTimeExcessConnections -> 0, maxPoolSize -> 30, maxStatements -> 0, maxStatementsPerConnection -> 0, minPoolSize -> 10, numHelperThreads -> 3, preferredTestQuery -> null, privilegeSpawnedThreads -> false, properties -> {user=******, password=******}, propertyCycle -> 0, statementCacheNumDeferredCloseThreads -> 0, testConnectionOnCheckin -> false, testConnectionOnCheckout -> false, unreturnedConnectionTimeout -> 0, userOverrides -> {}, usesTraditionalReflectiveProxies -> false ]
2023-03-23 01:28:52.675 [main] DEBUG c.imooc.o2o.dao.split.DynamicDataSourceInterceptor - 设置方法[com.imooc.o2o.dao.AreaDao.queryArea] use [slave] Strategy, SqlCommanType [SELECT]…
2023-03-23 01:28:52.683 [main] DEBUG com.imooc.o2o.dao.split.DynamicDataSourceHolder - 所使用的数据源为:slave
2023-03-23 01:28:52.737 [main] INFO c.m.v2.c3p0.impl.AbstractPoolBackedDataSource - Initializing c3p0 pool… com.mchange.v2.c3p0.ComboPooledDataSource [ acquireIncrement -> 3, acquireRetryAttempts -> 2, acquireRetryDelay -> 1000, autoCommitOnClose -> false, automaticTestTable -> null, breakAfterAcquireFailure -> false, checkoutTimeout -> 10000, connectionCustomizerClassName -> null, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, contextClassLoaderSource -> caller, dataSourceName -> z8kfltav2vjgkc9rfbsi|3e2055d6, debugUnreturnedConnectionStackTraces -> false, description -> null, driverClass -> com.mysql.cj.jdbc.Driver, extensions -> {}, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, forceSynchronousCheckins -> false, forceUseNamedDriverClass -> false, identityToken -> z8kfltav2vjgkc9rfbsi|3e2055d6, idleConnectionTestPeriod -> 0, initialPoolSize -> 10, jdbcUrl -> jdbc:mysql://106.13.78.180:3306/o2o?useUnicode=true&characterEncoding=utf8&serverTimezone=UTC, maxAdministrativeTaskTime -> 0, maxConnectionAge -> 0, maxIdleTime -> 0, maxIdleTimeExcessConnections -> 0, maxPoolSize -> 30, maxStatements -> 0, maxStatementsPerConnection -> 0, minPoolSize -> 10, numHelperThreads -> 3, preferredTestQuery -> null, privilegeSpawnedThreads -> false, properties -> {user=******, password=******}, propertyCycle -> 0, statementCacheNumDeferredCloseThreads -> 0, testConnectionOnCheckin -> false, testConnectionOnCheckout -> false, unreturnedConnectionTimeout -> 0, userOverrides -> {}, usesTraditionalReflectiveProxies -> false ]
2023-03-23 01:29:01.560 [C3P0PooledConnectionPoolManager[identityToken->z8kfltav2vjgkc9rfbsi|710c2b53]-AdminTaskTimer] WARN com.mchange.v2.async.ThreadPoolAsynchronousRunner - com.mchange.v2.async.ThreadPoolAsynchronousRunnerDeadlockDetector@5d374101−−APPARENTDEADLOCK!!!Creatingemergencythreadsforunassignedpendingtasks!2023−03−2301:29:01.565[C3P0PooledConnectionPoolManager[identityToken−>z8kfltav2vjgkc9rfbsi∣710c2b53]−AdminTaskTimer]WARNcom.mchange.v2.async.ThreadPoolAsynchronousRunner−com.mchange.v2.async.ThreadPoolAsynchronousRunnerDeadlockDetector@5d374101 -- APPARENT DEADLOCK!!! Creating emergency threads for unassigned pending tasks!
2023-03-23 01:29:01.565 [C3P0PooledConnectionPoolManager[identityToken->z8kfltav2vjgkc9rfbsi|710c2b53]-AdminTaskTimer] WARN com.mchange.v2.async.ThreadPoolAsynchronousRunner - com.mchange.v2.async.ThreadPoolAsynchronousRunnerDeadlockDetector@5d374101−−APPARENTDEADLOCK!!!Creatingemergencythreadsforunassignedpendingtasks!2023−03−2301:29:01.565[C3P0PooledConnectionPoolManager[identityToken−>z8kfltav2vjgkc9rfbsi∣710c2b53]−AdminTaskTimer]WARNcom.mchange.v2.async.ThreadPoolAsynchronousRunner−com.mchange.v2.async.ThreadPoolAsynchronousRunnerDeadlockDetector@5d374101 – APPARENT DEADLOCK!!! Complete Status:
Managed Threads: 3
Active Threads: 3
Active Tasks:
com.mchange.v2.resourcepool.BasicResourcePoolKaTeX parse error: Expected 'EOF', got '#' at position 136: …]-HelperThread-#̲1
com.mchange…ScatteredAcquireTask@7515dafd
on thread: C3P0PooledConnectionPoolManager[identityToken->z8kfltav2vjgkc9rfbsi|710c2b53]-HelperThread-#0
com.mchange.v2.resourcepool.BasicResourcePoolKaTeX parse error: Expected 'EOF', got '#' at position 136: …]-HelperThread-#̲2
Pending Task…ScatteredAcquireTask@d27b435
com.mchange.v2.resourcepool.BasicResourcePoolScatteredAcquireTask@72e241a3com.mchange.v2.resourcepool.BasicResourcePoolScatteredAcquireTask@72e241a3
com.mchange.v2.resourcepool.BasicResourcePoolScatteredAcquireTask@72e241a3com.mchange.v2.resourcepool.BasicResourcePoolScatteredAcquireTask@29fbbf30
com.mchange.v2.resourcepool.BasicResourcePoolScatteredAcquireTask@26156525com.mchange.v2.resourcepool.BasicResourcePoolScatteredAcquireTask@26156525
com.mchange.v2.resourcepool.BasicResourcePoolScatteredAcquireTask@26156525com.mchange.v2.resourcepool.BasicResourcePoolScatteredAcquireTask@1623fbce
com.mchange.v2.resourcepool.BasicResourcePoolScatteredAcquireTask@76ac5ff0com.mchange.v2.resourcepool.BasicResourcePoolScatteredAcquireTask@76ac5ff0
com.mchange.v2.resourcepool.BasicResourcePoolScatteredAcquireTask@76ac5ff0com.mchange.v2.resourcepool.BasicResourcePoolScatteredAcquireTask@2da7c2a
Pool thread stack traces:
Thread[C3P0PooledConnectionPoolManager[identityToken->z8kfltav2vjgkc9rfbsi|710c2b53]-HelperThread-#0,5,main]
java.net.SocketInputStream.socketRead0(Native Method)
java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
java.net.SocketInputStream.read(SocketInputStream.java:171)
java.net.SocketInputStream.read(SocketInputStream.java:141)
com.mysql.cj.protocol.ReadAheadInputStream.fill(ReadAheadInputStream.java:107)
com.mysql.cj.protocol.ReadAheadInputStream.readFromUnderlyingStreamIfNecessary(ReadAheadInputStream.java:150)
com.mysql.cj.protocol.ReadAheadInputStream.read(ReadAheadInputStream.java:180)
java.io.FilterInputStream.read(FilterInputStream.java:133)
com.mysql.cj.protocol.FullReadInputStream.readFully(FullReadInputStream.java:64)
com.mysql.cj.protocol.a.SimplePacketReader.readHeader(SimplePacketReader.java:63)
com.mysql.cj.protocol.a.SimplePacketReader.readHeader(SimplePacketReader.java:45)
com.mysql.cj.protocol.a.NativeProtocol.readMessage(NativeProtocol.java:556)
com.mysql.cj.protocol.a.NativeProtocol.readServerCapabilities(NativeProtocol.java:514)
com.mysql.cj.protocol.a.NativeProtocol.beforeHandshake(NativeProtocol.java:404)
com.mysql.cj.protocol.a.NativeProtocol.connect(NativeProtocol.java:1450)
com.mysql.cj.NativeSession.connect(NativeSession.java:165)
com.mysql.cj.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:955)
com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:825)
com.mysql.cj.jdbc.ConnectionImpl.(ConnectionImpl.java:455)
com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:240)
com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:199)
com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:175)
com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:220)
com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:206)
com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:203)
com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1176)
com.mchange.v2.resourcepool.BasicResourcePool.doAcquireAndDecrementPendingAcquiresWithinLockOnSuccess(BasicResourcePool.java:1163)
com.mchange.v2.resourcepool.BasicResourcePool.access700(BasicResourcePool.java:44)com.mchange.v2.resourcepool.BasicResourcePool700(BasicResourcePool.java:44)
com.mchange.v2.resourcepool.BasicResourcePool700(BasicResourcePool.java:44)com.mchange.v2.resourcepool.BasicResourcePoolScatteredAcquireTask.run(BasicResourcePool.java:1908)
com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:696)
Thread[C3P0PooledConnectionPoolManager[identityToken->z8kfltav2vjgkc9rfbsi|710c2b53]-HelperThread-#1,5,main]
java.net.SocketInputStream.socketRead0(Native Method)
java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
java.net.SocketInputStream.read(SocketInputStream.java:171)
java.net.SocketInputStream.read(SocketInputStream.java:141)
com.mysql.cj.protocol.ReadAheadInputStream.fill(ReadAheadInputStream.java:107)
com.mysql.cj.protocol.ReadAheadInputStream.readFromUnderlyingStreamIfNecessary(ReadAheadInputStream.java:150)
com.mysql.cj.protocol.ReadAheadInputStream.read(ReadAheadInputStream.java:180)
java.io.FilterInputStream.read(FilterInputStream.java:133)
com.mysql.cj.protocol.FullReadInputStream.readFully(FullReadInputStream.java:64)
com.mysql.cj.protocol.a.SimplePacketReader.readHeader(SimplePacketReader.java:63)
com.mysql.cj.protocol.a.SimplePacketReader.readHeader(SimplePacketReader.java:45)
com.mysql.cj.protocol.a.NativeProtocol.readMessage(NativeProtocol.java:556)
com.mysql.cj.protocol.a.NativeProtocol.readServerCapabilities(NativeProtocol.java:514)
com.mysql.cj.protocol.a.NativeProtocol.beforeHandshake(NativeProtocol.java:404)
com.mysql.cj.protocol.a.NativeProtocol.connect(NativeProtocol.java:1450)
com.mysql.cj.NativeSession.connect(NativeSession.java:165)
com.mysql.cj.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:955)
com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:825)
com.mysql.cj.jdbc.ConnectionImpl.(ConnectionImpl.java:455)
com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:240)
com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:199)
com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:175)
com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:220)
com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:206)
com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:203)
com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1176)
com.mchange.v2.resourcepool.BasicResourcePool.doAcquireAndDecrementPendingAcquiresWithinLockOnSuccess(BasicResourcePool.java:1163)
com.mchange.v2.resourcepool.BasicResourcePool.access700(BasicResourcePool.java:44)com.mchange.v2.resourcepool.BasicResourcePool700(BasicResourcePool.java:44)
com.mchange.v2.resourcepool.BasicResourcePool700(BasicResourcePool.java:44)com.mchange.v2.resourcepool.BasicResourcePoolScatteredAcquireTask.run(BasicResourcePool.java:1908)
com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:696)
Thread[C3P0PooledConnectionPoolManager[identityToken->z8kfltav2vjgkc9rfbsi|710c2b53]-HelperThread-#2,5,main]
java.net.SocketInputStream.socketRead0(Native Method)
java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
java.net.SocketInputStream.read(SocketInputStream.java:171)
java.net.SocketInputStream.read(SocketInputStream.java:141)
com.mysql.cj.protocol.ReadAheadInputStream.fill(ReadAheadInputStream.java:107)
com.mysql.cj.protocol.ReadAheadInputStream.readFromUnderlyingStreamIfNecessary(ReadAheadInputStream.java:150)
com.mysql.cj.protocol.ReadAheadInputStream.read(ReadAheadInputStream.java:180)
java.io.FilterInputStream.read(FilterInputStream.java:133)
com.mysql.cj.protocol.FullReadInputStream.readFully(FullReadInputStream.java:64)
com.mysql.cj.protocol.a.SimplePacketReader.readHeader(SimplePacketReader.java:63)
com.mysql.cj.protocol.a.SimplePacketReader.readHeader(SimplePacketReader.java:45)
com.mysql.cj.protocol.a.NativeProtocol.readMessage(NativeProtocol.java:556)
com.mysql.cj.protocol.a.NativeProtocol.readServerCapabilities(NativeProtocol.java:514)
com.mysql.cj.protocol.a.NativeProtocol.beforeHandshake(NativeProtocol.java:404)
com.mysql.cj.protocol.a.NativeProtocol.connect(NativeProtocol.java:1450)
com.mysql.cj.NativeSession.connect(NativeSession.java:165)
com.mysql.cj.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:955)
com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:825)
com.mysql.cj.jdbc.ConnectionImpl.(ConnectionImpl.java:455)
com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:240)
com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:199)
com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:175)
com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:220)
com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:206)
com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:203)
com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1176)
com.mchange.v2.resourcepool.BasicResourcePool.doAcquireAndDecrementPendingAcquiresWithinLockOnSuccess(BasicResourcePool.java:1163)
com.mchange.v2.resourcepool.BasicResourcePool.access700(BasicResourcePool.java:44)com.mchange.v2.resourcepool.BasicResourcePool700(BasicResourcePool.java:44)
com.mchange.v2.resourcepool.BasicResourcePool700(BasicResourcePool.java:44)com.mchange.v2.resourcepool.BasicResourcePoolScatteredAcquireTask.run(BasicResourcePool.java:1908)
com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:696)
……
1回答
-
翔仔
2023-03-23
同学好,需要贴Caused by 打头的异常,我看后面还有省略号,不贴出来没法精确定位,此外,failure trace 这个标签的内容也贴下
022023-03-28
相似问题