老师,我找了好久还是没找到,数据库配置我都看了好几遍,没发现什么问题,好难受~~

来源:3-2 logback的配置

慕斯卡6955199

2018-01-30

"C:\Program Files\Java\jdk1.8.0_152\bin\java" -ea -Didea.test.cyclic.buffer.size=1048576 "-javaagent:D:\development tool\IntelliJ IDEA 2017.3.2\lib\idea_rt.jar=56783:D:\development tool\IntelliJ IDEA 2017.3.2\bin" -Dfile.encoding=UTF-8 -classpath "D:\development tool\IntelliJ IDEA 2017.3.2\lib\idea_rt.jar;D:\development tool\IntelliJ IDEA 2017.3.2\plugins\junit\lib\junit-rt.jar;D:\development tool\IntelliJ IDEA 2017.3.2\plugins\junit\lib\junit5-rt.jar;C:\Program Files\Java\jdk1.8.0_152\jre\lib\charsets.jar;C:\Program Files\Java\jdk1.8.0_152\jre\lib\deploy.jar;C:\Program Files\Java\jdk1.8.0_152\jre\lib\ext\access-bridge-64.jar;C:\Program Files\Java\jdk1.8.0_152\jre\lib\ext\cldrdata.jar;C:\Program Files\Java\jdk1.8.0_152\jre\lib\ext\dnsns.jar;C:\Program Files\Java\jdk1.8.0_152\jre\lib\ext\jaccess.jar;C:\Program Files\Java\jdk1.8.0_152\jre\lib\ext\jfxrt.jar;C:\Program Files\Java\jdk1.8.0_152\jre\lib\ext\localedata.jar;C:\Program Files\Java\jdk1.8.0_152\jre\lib\ext\nashorn.jar;C:\Program Files\Java\jdk1.8.0_152\jre\lib\ext\sunec.jar;C:\Program Files\Java\jdk1.8.0_152\jre\lib\ext\sunjce_provider.jar;C:\Program Files\Java\jdk1.8.0_152\jre\lib\ext\sunmscapi.jar;C:\Program Files\Java\jdk1.8.0_152\jre\lib\ext\sunpkcs11.jar;C:\Program Files\Java\jdk1.8.0_152\jre\lib\ext\zipfs.jar;C:\Program Files\Java\jdk1.8.0_152\jre\lib\javaws.jar;C:\Program Files\Java\jdk1.8.0_152\jre\lib\jce.jar;C:\Program Files\Java\jdk1.8.0_152\jre\lib\jfr.jar;C:\Program Files\Java\jdk1.8.0_152\jre\lib\jfxswt.jar;C:\Program Files\Java\jdk1.8.0_152\jre\lib\jsse.jar;C:\Program Files\Java\jdk1.8.0_152\jre\lib\management-agent.jar;C:\Program Files\Java\jdk1.8.0_152\jre\lib\plugin.jar;C:\Program Files\Java\jdk1.8.0_152\jre\lib\resources.jar;C:\Program Files\Java\jdk1.8.0_152\jre\lib\rt.jar;E:\o2o\out\test\classes;E:\o2o\out\production\classes;E:\o2o\out\production\resources;C:\Users\lzw\.gradle\caches\modules-2\files-2.1\ch.qos.logback\logback-classic\1.2.3\7c4f3c474fb2c041d8028740440937705ebb473a\logback-classic-1.2.3.jar;C:\Users\lzw\.gradle\caches\modules-2\files-2.1\org.springframework\spring-webmvc\4.3.7.RELEASE\d25b11a605589f176e3ecf1dcae62a991a18b377\spring-webmvc-4.3.7.RELEASE.jar;C:\Users\lzw\.gradle\caches\modules-2\files-2.1\org.springframework\spring-web\4.3.7.RELEASE\7b69fc68cdb74c1c92f72905af6995696fcb56aa\spring-web-4.3.7.RELEASE.jar;C:\Users\lzw\.gradle\caches\modules-2\files-2.1\org.springframework\spring-context\4.3.7.RELEASE\34b66b0b7910122ef95ba4fff6da9238ef80a5de\spring-context-4.3.7.RELEASE.jar;C:\Users\lzw\.gradle\caches\modules-2\files-2.1\org.springframework\spring-jdbc\4.3.7.RELEASE\305c8db0f9552948aec093528cd01393cc98a646\spring-jdbc-4.3.7.RELEASE.jar;C:\Users\lzw\.gradle\caches\modules-2\files-2.1\org.springframework\spring-tx\4.3.7.RELEASE\b761cc783e49b5aa998ac63a721495a9f0f69f9c\spring-tx-4.3.7.RELEASE.jar;C:\Users\lzw\.gradle\caches\modules-2\files-2.1\org.springframework\spring-aop\4.3.7.RELEASE\3f243d685e4a8a78a0c291445c6d85560ec4d339\spring-aop-4.3.7.RELEASE.jar;C:\Users\lzw\.gradle\caches\modules-2\files-2.1\org.springframework\spring-beans\4.3.7.RELEASE\2de9f59f3202965438f3a02057d6ad8274636044\spring-beans-4.3.7.RELEASE.jar;C:\Users\lzw\.gradle\caches\modules-2\files-2.1\org.springframework\spring-test\4.3.7.RELEASE\480fc4673b53daa1993eb1940711828ebf35807b\spring-test-4.3.7.RELEASE.jar;C:\Users\lzw\.gradle\caches\modules-2\files-2.1\org.springframework\spring-expression\4.3.7.RELEASE\5257b6486e43d8c05674323fea5b415d4da72f38\spring-expression-4.3.7.RELEASE.jar;C:\Users\lzw\.gradle\caches\modules-2\files-2.1\org.springframework\spring-core\4.3.7.RELEASE\54fa2db94cc7222edc90ec71354e47cd1dc07f7b\spring-core-4.3.7.RELEASE.jar;C:\Users\lzw\.gradle\caches\modules-2\files-2.1\com.github.penggle\kaptcha\2.3.2\a3e13fd05bae905d67eafb40b712a1b624daef3b\kaptcha-2.3.2.jar;C:\Users\lzw\.gradle\caches\modules-2\files-2.1\javax.servlet\javax.servlet-api\3.1.0\3cd63d075497751784b2fa84be59432f4905bf7c\javax.servlet-api-3.1.0.jar;C:\Users\lzw\.gradle\caches\modules-2\files-2.1\com.fasterxml.jackson.core\jackson-databind\2.8.7\6c3257ef458ac58a8da69a6dca3d2a15286d88c8\jackson-databind-2.8.7.jar;C:\Users\lzw\.gradle\caches\modules-2\files-2.1\commons-collections\commons-collections\3.2\f951934aa5ae5a88d7e6dfaa6d32307d834a88be\commons-collections-3.2.jar;C:\Users\lzw\.gradle\caches\modules-2\files-2.1\org.mybatis\mybatis\3.4.2\2b9a5082fe0bdb3128bab8b4b19b23ca0f3d9b38\mybatis-3.4.2.jar;C:\Users\lzw\.gradle\caches\modules-2\files-2.1\org.mybatis\mybatis-spring\1.3.1\5197169e15a43066f177a1cd12a098e1283fdc76\mybatis-spring-1.3.1.jar;C:\Users\lzw\.gradle\caches\modules-2\files-2.1\mysql\mysql-connector-java\5.1.37\2c378637f6faff77541244e8257b446f04324bd8\mysql-connector-java-5.1.37.jar;C:\Users\lzw\.gradle\caches\modules-2\files-2.1\c3p0\c3p0\0.9.1.2\4ea71601f844c4b90d22195bbdb58979281bb8b6\c3p0-0.9.1.2.jar;C:\Users\lzw\.gradle\caches\modules-2\files-2.1\net.coobird\thumbnailator\0.4.8\4f10c440dd7776630aee9da4611a45032db1e041\thumbnailator-0.4.8.jar;C:\Users\lzw\.gradle\caches\modules-2\files-2.1\commons-fileupload\commons-fileupload\1.3.2\5d7491ed6ebd02b6a8d2305f8e6b7fe5dbd95f72\commons-fileupload-1.3.2.jar;C:\Users\lzw\.gradle\caches\modules-2\files-2.1\redis.clients\jedis\2.9.0\292bc9cc26553acd3cccc26f2f95620bf88a04c2\jedis-2.9.0.jar;C:\Users\lzw\.gradle\caches\modules-2\files-2.1\junit\junit\4.12\2973d150c0dc1fefe998f834810d68f278ea58ec\junit-4.12.jar;C:\Users\lzw\.gradle\caches\modules-2\files-2.1\ch.qos.logback\logback-core\1.2.3\864344400c3d4d92dfeb0a305dc87d953677c03c\logback-core-1.2.3.jar;C:\Users\lzw\.gradle\caches\modules-2\files-2.1\org.slf4j\slf4j-api\1.7.25\da76ca59f6a57ee3102f8f9bd9cee742973efa8a\slf4j-api-1.7.25.jar;C:\Users\lzw\.gradle\caches\modules-2\files-2.1\commons-logging\commons-logging\1.2\4bfc12adfe4842bf07b657f0369c4cb522955686\commons-logging-1.2.jar;C:\Users\lzw\.gradle\caches\modules-2\files-2.1\com.fasterxml.jackson.core\jackson-annotations\2.8.0\45b426f7796b741035581a176744d91090e2e6fb\jackson-annotations-2.8.0.jar;C:\Users\lzw\.gradle\caches\modules-2\files-2.1\com.fasterxml.jackson.core\jackson-core\2.8.7\8b46f39c78476fb848c81a49fa807a9e9506dddd\jackson-core-2.8.7.jar;C:\Users\lzw\.gradle\caches\modules-2\files-2.1\com.jhlabs\filters\2.0.235-1\fff65ebe39d1097cee431087858b3caf957ecfb7\filters-2.0.235-1.jar;C:\Users\lzw\.gradle\caches\modules-2\files-2.1\commons-io\commons-io\2.2\83b5b8a7ba1c08f9e8c8ff2373724e33d3c1e22a\commons-io-2.2.jar;C:\Users\lzw\.gradle\caches\modules-2\files-2.1\org.apache.commons\commons-pool2\2.4.2\e5f4f28f19d57716fbc3989d7a357ebf1e454fea\commons-pool2-2.4.2.jar;C:\Users\lzw\.gradle\caches\modules-2\files-2.1\org.hamcrest\hamcrest-core\1.3\42a25dc3219429f0e5d060061f71acb49bf010a0\hamcrest-core-1.3.jar" com.intellij.rt.execution.junit.JUnitStarter -ideVersion5 -junit4 com.imooc.o2o.dao.AreaDaoTest,testQueryArea

一月 30, 2018 10:00:26 上午 org.springframework.test.context.support.DefaultTestContextBootstrapper getDefaultTestExecutionListenerClassNames

信息: 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]

一月 30, 2018 10:00:26 上午 org.springframework.test.context.support.DefaultTestContextBootstrapper getTestExecutionListeners

信息: Using TestExecutionListeners: [org.springframework.test.context.web.ServletTestExecutionListener@2d3fcdbd, org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener@617c74e5, org.springframework.test.context.support.DependencyInjectionTestExecutionListener@6537cf78, org.springframework.test.context.support.DirtiesContextTestExecutionListener@67b6d4ae, org.springframework.test.context.transaction.TransactionalTestExecutionListener@34b7bfc0, org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener@366e2eef]

一月 30, 2018 10:00:26 上午 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions

信息: Loading XML bean definitions from class path resource [spring/spring-dao.xml]

一月 30, 2018 10:00:27 上午 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions

信息: Loading XML bean definitions from class path resource [spring/spring-service.xml]

一月 30, 2018 10:00:27 上午 org.springframework.context.support.GenericApplicationContext prepareRefresh

信息: Refreshing org.springframework.context.support.GenericApplicationContext@8bd1b6a: startup date [Tue Jan 30 10:00:27 CST 2018]; root of context hierarchy

一月 30, 2018 10:00:27 上午 com.mchange.v2.log.MLog <clinit>

信息: MLog clients using java 1.4+ standard logging.

一月 30, 2018 10:00:27 上午 com.mchange.v2.c3p0.C3P0Registry banner

信息: Initializing c3p0-0.9.1.2 [built 21-May-2007 15:04:56; debug? true; trace: 10]

一月 30, 2018 10:00:28 上午 com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource getPoolManager

信息: 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, dataSourceName -> 1hgf11d9tj35wplj2eh7f|3a93b025, debugUnreturnedConnectionStackTraces -> false, description -> null, driverClass -> com.mysql.jdbc.Driver, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, identityToken -> 1hgf11d9tj35wplj2eh7f|3a93b025, idleConnectionTestPeriod -> 0, initialPoolSize -> 3, jdbcUrl -> jdbc:mysql://localhost:3306/o2o?useUnicode=true&characterEncoding=utf8, maxAdministrativeTaskTime -> 0, maxConnectionAge -> 0, maxIdleTime -> 0, maxIdleTimeExcessConnections -> 0, maxPoolSize -> 30, maxStatements -> 0, maxStatementsPerConnection -> 0, minPoolSize -> 10, numHelperThreads -> 3, numThreadsAwaitingCheckoutDefaultUser -> 0, preferredTestQuery -> null, properties -> {user=******, password=******}, propertyCycle -> 0, testConnectionOnCheckin -> false, testConnectionOnCheckout -> false, unreturnedConnectionTimeout -> 0, usesTraditionalReflectiveProxies -> false ]

一月 30, 2018 10:00:29 上午 com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask run

警告: com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@65d614e6 -- 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 (2). Last acquisition attempt exception: 

java.sql.SQLException: Unknown system variable 'query_cache_size'

at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:959)


一月 30, 2018 10:00:29 上午 com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask run

警告: com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@8902ab2 -- 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 (2). Last acquisition attempt exception: 

java.sql.SQLException: Unknown system variable 'query_cache_size'

at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:959)


一月 30, 2018 10:00:29 上午 com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask run

警告: com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@66b24222 -- 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 (2). Last acquisition attempt exception: 

java.sql.SQLException: Unknown system variable 'query_cache_size'

at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:959)


org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException: 

### Error querying database.  Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is java.sql.SQLException: Connections could not be acquired from the underlying database!

### The error may exist in file [E:\o2o\out\production\resources\mapper\AreaDao.xml]

### The error may involve com.imooc.o2o.dao.AreaDao.queryArea

### The error occurred while executing a query

### Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is java.sql.SQLException: Connections could not be acquired from the underlying database!


at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:77)

Caused by: org.apache.ibatis.exceptions.PersistenceException: 

### Error querying database.  Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is java.sql.SQLException: Connections could not be acquired from the underlying database!

### The error may exist in file [E:\o2o\out\production\resources\mapper\AreaDao.xml]

### The error may involve com.imooc.o2o.dao.AreaDao.queryArea

### The error occurred while executing a query

### Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is java.sql.SQLException: Connections could not be acquired from the underlying database!

at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30)

... 35 more

Caused by: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is java.sql.SQLException: Connections could not be acquired from the underlying database!

at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:80)


... 41 more

Caused by: java.sql.SQLException: Connections could not be acquired from the underlying database!

at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:106)


... 51 more

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:1319)

... 54 more

一月 30, 2018 10:00:29 上午 org.springframework.context.support.GenericApplicationContext doClose

信息: Closing org.springframework.context.support.GenericApplicationContext@8bd1b6a: startup date [Tue Jan 30 10:00:27 CST 2018]; root of context hierarchy


Process finished with exit code -1


写回答

2回答

翔仔

2018-01-30

同学好,援军抵达,一定要耐心啊,一开始肯定会碰到这样那样的问题,自己解决了才能获得进步,一帆风顺就学不到东西了:)

同学要耐心看错误,一般是cause by 附近,这里是

java.sql.SQLException: Unknown system variable 'query_cache_size'

说同学配置了这个未知的系统变量query_cache_size,不知道同学的为什么会有这个,应该是mysql的驱动版本和你当前的mysql版本不兼容导致。。需要同学将mysql换个版本或者更换个mysql驱动 :)


0
0

NullPointerExcep

2018-01-30

哇你这个黑底白字是真的看不进去(。・∀・)ノ゙

0
2
NullPointerExcep
回复
翔仔
老实说有没有ctrl+f(。・∀・)ノ゙
2018-01-31
共2条回复

Java双版本(SSM到SpringBoot)校园商铺全栈开发

SSM商铺V1.0,解决毕设痛点;SpringBoot商铺V2.0,满足工作刚需

5113 学习 · 8144 问题

查看课程