The ssm framework built by maven is a problem encountered when using the latest mysql 6.0jar, mavenssm

Source: Internet
Author: User

The ssm framework built by maven is a problem encountered when using the latest mysql 6.0jar, mavenssm

By blouc@qq.com
This article is original author, reproduced please indicate the source: https://www.cnblogs.com/oucbl/p/5940556.html

Today, I learned how to integrate the SSM framework and complete the integration of the Spring and mybatis frameworks. Many problems arise from the configuration file.

I will focus on Mysql DATA driver configuration.

When configuring pom. xml, I went to the MySQL Connector/J website and found the latest version. I also configured it out of curiosity...

<!-- https://mvnrepository.com/artifact/mysql/mysql-connector-java --><dependency>    <groupId>mysql</groupId>    <artifactId>mysql-connector-java</artifactId>    <version>6.0.4</version></dependency>
To solve the problem, the driver configuration of the new version has changed: 1. the time zone must be set for url Connection.
### MySQL Connector/J 5.x (old connection) # jdbc. url = jdbc: mysql: // 127.0.0.1: 3306/test? UseUnicode = true & characterEncoding = utf8 ### MySQL Connector/J 6.x (new connection) jdbc. url = jdbc: mysql: // test? ServerTimezone = UTC & characterEncoding = utf8 & useUnicode = true & useSSL = false

Note:The default address of the new driver url is 127.0.0.1: 3306. Therefore, the address for accessing the mysql database on the local machine can be expressed.

2. The driver class location has changed (does not affect usage, but a warning is reported)
### MySQL Connector/J 5.x (old driver) # jdbc. driver_class = com. mysql. jdbc. driver ### MySQL Connector/J 6.x (New Driver) jdbc. driver_class = com. mysql. cj. jdbc. driver

View exceptions

[INFO] Initializing c3p0 pool... com. mchange. v2.c3p0. comboPooledDataSource [acquireIncrement-> 3, metrics-> 30, acquireRetryDelay-> 1000, autoCommitOnClose-> false, automaticTestTable-> null, metrics-> false, checkoutTimeout-> 0, connectionCustomizerClassName-> null, connectionTesterClassName-> com. mchange. v2.c3p0. impl. defaultConnectionTester, contextClassLoa DerSource-> caller, CENAME-> 1hgev419te1s9xe1nd08ye | 1a79131, debugUnreturnedConnectionStackTraces-> false, description-> null, driverClass-> com. mysql. jdbc. driver, extensions->{}, factoryClassLocation-> null, parameters-> false, forceSynchronousCheckins-> false, forceUseNamedDriverClass-> false, identityToken-> identifier | 1a79131, idleConnecti OnTestPeriod-> 0, initialPoolSize-> 3, jdbcUrl-> jdbc: mysql: // localhost: 3306/ssm? UseSSL = false, strong-> 0, maxConnectionAge-> 0, maxIdleTime-> 0, maxIdleTimeExcessConnections-> 0, maxPoolSize-> 15, maxStatements-> 0, maxStatementsPerConnection-> 0, minPoolSize-> 3, numHelperThreads-> 3, preferredTestQuery-> null, privilegeSpawnedThreads-> false, properties-> {user = ******, password = *****}, propertyCycle-> 0, statementCacheNumDeferredCloseThreads-> 0, testConnectionOnCheckin-> false, testconnectioncheckout-> false, unreturnedConnectionTimeout-> 0, userOverrides->{}, usesTraditionalReflectiveProxies-> false]
Loading class 'com. mysql. jdbc. driver '. this is deprecated. the new driver class is 'com. mysql. cj. jdbc. driver '. the driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.
[WARNING] com. mchange. v2.resourcepool. BasicResourcePool $ ScatteredAcquireTask @ 1eb28fe -- 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 (30). Last acquisition attempt exception:
Java. SQL. SQLException: The server time zone value 'is unrecognized or represents more than one time zone. you must configure either the server or JDBC driver (via the serverTimezone configuration property) to use a more specifc time zone value if you want to utilize time zone support.
At com. mysql. cj. jdbc. exceptions. SQLError. createSQLException (SQLError. java: 545)
At com. mysql. cj. jdbc. exceptions. SQLError. createSQLException (SQLError. java: 513)
At com. mysql. cj. jdbc. exceptions. SQLError. createSQLException (SQLError. java: 505)
At com. mysql. cj. jdbc. exceptions. SQLError. createSQLException (SQLError. java: 479)
At com. mysql. cj. jdbc. exceptions. SQLError. createSQLException (SQLError. java: 489)
At com. mysql. cj. jdbc. exceptions. SQLExceptionsMapping. translateException (SQLExceptionsMapping. java: 69)
At com. mysql. cj. jdbc. ConnectionImpl. createNewIO (ConnectionImpl. java: 1606)
At com. mysql. cj. jdbc. ConnectionImpl. <init> (ConnectionImpl. java: 633)
At com. mysql. cj. jdbc. ConnectionImpl. getInstance (ConnectionImpl. java: 347)
At com. mysql. cj. jdbc. NonRegisteringDriver. connect (NonRegisteringDriver. java: 219)
At com. mchange. v2.c3p0. DriverManagerDataSource. getConnection (DriverManagerDataSource. java: 175)
At com. mchange. v2.c3p0. WrapperConnectionPoolDataSource. getPooledConnection (WrapperConnectionPoolDataSource. java: 220)
At com. mchange. v2.c3p0. WrapperConnectionPoolDataSource. getPooledConnection (WrapperConnectionPoolDataSource. java: 206)
At com. mchange. v2.c3p0. impl. C3P0PooledConnectionPool $ 1PooledConnectionResourcePoolManager. acquireResource (C3P0PooledConnectionPool. java: 203)
At com. mchange. v2.resourcepool. BasicResourcePool. doAcquire (BasicResourcePool. java: 1138)
At com. mchange. v2.resourcepool. BasicResourcePool. doAcquireAndDecrementPendingAcquiresWithinLockOnSuccess (BasicResourcePool. java: 1125)
At com. mchange. v2.resourcepool. BasicResourcePool. access $700 (BasicResourcePool. java: 44)
At com. mchange. v2.resourcepool. BasicResourcePool $ ScatteredAcquireTask. run (BasicResourcePool. java: 1870)
At com. mchange. v2.async. ThreadPoolAsynchronousRunner $ PoolThread. run (ThreadPoolAsynchronousRunner. java: 696)
Caused by: com. mysql. cj. core. exceptions. invalidConnectionAttributeException: The server time zone value 'is unrecognized or represents more than one time zone. you must configure either the server or JDBC driver (via the serverTimezone configuration property) to use a more specifc time zone value if you want to utilize time zone support.
At sun. reflect. GeneratedConstructorAccessor28.newInstance (Unknown Source)
At sun. reflect. delegatingconstruct%cessorimpl. newInstance (delegatingconstruct%cessorimpl. java: 45)
At java. lang. reflect. Constructor. newInstance (Constructor. java: 423)
At com. mysql. cj. core. exceptions. ExceptionFactory. createException (ExceptionFactory. java: 54)
At com. mysql. cj. core. exceptions. ExceptionFactory. createException (ExceptionFactory. java: 73)
At com. mysql. cj. jdbc. util. TimeUtil. getCanonicalTimezone (TimeUtil. java: 118)
At com. mysql. cj. mysqla. MysqlaSession. configureTimezone (MysqlaSession. java: 293)
At com. mysql. cj. jdbc. ConnectionImpl. initializePropsFromServer (ConnectionImpl. java: 2399)
At com. mysql. cj. jdbc. ConnectionImpl. connectOneTryOnly (ConnectionImpl. java: 1739)
At com. mysql. cj. jdbc. ConnectionImpl. createNewIO (ConnectionImpl. java: 1596)
... 12 more
[WARNING] Having failed to acquire a resource, com. mchange. v2.resourcepool. basicResourcePool @ 1e877aa is interrupting all Threads waiting on a resource to check out. will try again in response to new client requests.
January 26 9:23:48 org. apache. catalina. core. StandardWrapperValve invoke
Severe: Servlet. service () for servlet [springmvc] in context with path [/maven_ssm_01] threw exception [Request processing failed; nested exception is org. springframework. transaction. cannotCreateTransactionException: cocould not open JDBC Connection for transaction; nested exception is java. SQL. SQLException: Connections cocould not be acquired from the underlying database!] With root cause
Com. mysql. cj. core. exceptions. invalidConnectionAttributeException: The server time zone value 'is unrecognized or represents more than one time zone. you must configure either the server or JDBC driver (via the serverTimezone configuration property) to use a more specifc time zone value if you want to utilize time zone support.
At sun. reflect. GeneratedConstructorAccessor28.newInstance (Unknown Source)
At sun. reflect. delegatingconstruct%cessorimpl. newInstance (delegatingconstruct%cessorimpl. java: 45)
At java. lang. reflect. Constructor. newInstance (Constructor. java: 423)
At com. mysql. cj. core. exceptions. ExceptionFactory. createException (ExceptionFactory. java: 54)
At com. mysql. cj. core. exceptions. ExceptionFactory. createException (ExceptionFactory. java: 73)
At com. mysql. cj. jdbc. util. TimeUtil. getCanonicalTimezone (TimeUtil. java: 118)
At com. mysql. cj. mysqla. MysqlaSession. configureTimezone (MysqlaSession. java: 293)
At com. mysql. cj. jdbc. ConnectionImpl. initializePropsFromServer (ConnectionImpl. java: 2399)
At com. mysql. cj. jdbc. ConnectionImpl. connectOneTryOnly (ConnectionImpl. java: 1739)
At com. mysql. cj. jdbc. ConnectionImpl. createNewIO (ConnectionImpl. java: 1596)
At com. mysql. cj. jdbc. ConnectionImpl. <init> (ConnectionImpl. java: 633)
At com. mysql. cj. jdbc. ConnectionImpl. getInstance (ConnectionImpl. java: 347)
At com. mysql. cj. jdbc. NonRegisteringDriver. connect (NonRegisteringDriver. java: 219)
At com. mchange. v2.c3p0. DriverManagerDataSource. getConnection (DriverManagerDataSource. java: 175)
At com. mchange. v2.c3p0. WrapperConnectionPoolDataSource. getPooledConnection (WrapperConnectionPoolDataSource. java: 220)
At com. mchange. v2.c3p0. WrapperConnectionPoolDataSource. getPooledConnection (WrapperConnectionPoolDataSource. java: 206)
At com. mchange. v2.c3p0. impl. C3P0PooledConnectionPool $ 1PooledConnectionResourcePoolManager. acquireResource (C3P0PooledConnectionPool. java: 203)
At com. mchange. v2.resourcepool. BasicResourcePool. doAcquire (BasicResourcePool. java: 1138)
At com. mchange. v2.resourcepool. BasicResourcePool. doAcquireAndDecrementPendingAcquiresWithinLockOnSuccess (BasicResourcePool. java: 1125)
At com. mchange. v2.resourcepool. BasicResourcePool. access $700 (BasicResourcePool. java: 44)
At com. mchange. v2.resourcepool. BasicResourcePool $ ScatteredAcquireTask. run (BasicResourcePool. java: 1870)
At com. mchange. v2.async. ThreadPoolAsynchronousRunner $ PoolThread. run (ThreadPoolAsynchronousRunner. java: 696)

[WARNING] com. mchange. v2.resourcepool. BasicResourcePool $ ScatteredAcquireTask @ 1f869cf -- 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 (30). Last acquisition attempt exception:
Java. SQL. SQLException: The server time zone value 'is unrecognized or represents more than one time zone. you must configure either the server or JDBC driver (via the serverTimezone configuration property) to use a more specifc time zone value if you want to utilize time zone support.
At com. mysql. cj. jdbc. exceptions. SQLError. createSQLException (SQLError. java: 545)
At com. mysql. cj. jdbc. exceptions. SQLError. createSQLException (SQLError. java: 513)
At com. mysql. cj. jdbc. exceptions. SQLError. createSQLException (SQLError. java: 505)
At com. mysql. cj. jdbc. exceptions. SQLError. createSQLException (SQLError. java: 479)
At com. mysql. cj. jdbc. exceptions. SQLError. createSQLException (SQLError. java: 489)
At com. mysql. cj. jdbc. exceptions. SQLExceptionsMapping. translateException (SQLExceptionsMapping. java: 69)
At com. mysql. cj. jdbc. ConnectionImpl. createNewIO (ConnectionImpl. java: 1606)
At com. mysql. cj. jdbc. ConnectionImpl. <init> (ConnectionImpl. java: 633)
At com. mysql. cj. jdbc. ConnectionImpl. getInstance (ConnectionImpl. java: 347)
At com. mysql. cj. jdbc. NonRegisteringDriver. connect (NonRegisteringDriver. java: 219)
At com. mchange. v2.c3p0. DriverManagerDataSource. getConnection (DriverManagerDataSource. java: 175)
At com. mchange. v2.c3p0. WrapperConnectionPoolDataSource. getPooledConnection (WrapperConnectionPoolDataSource. java: 220)
At com. mchange. v2.c3p0. WrapperConnectionPoolDataSource. getPooledConnection (WrapperConnectionPoolDataSource. java: 206)
At com. mchange. v2.c3p0. impl. C3P0PooledConnectionPool $ 1PooledConnectionResourcePoolManager. acquireResource (C3P0PooledConnectionPool. java: 203)
At com. mchange. v2.resourcepool. BasicResourcePool. doAcquire (BasicResourcePool. java: 1138)
At com. mchange. v2.resourcepool. BasicResourcePool. doAcquireAndDecrementPendingAcquiresWithinLockOnSuccess (BasicResourcePool. java: 1125)
At com. mchange. v2.resourcepool. BasicResourcePool. access $700 (BasicResourcePool. java: 44)
At com. mchange. v2.resourcepool. BasicResourcePool $ ScatteredAcquireTask. run (BasicResourcePool. java: 1870)
At com. mchange. v2.async. ThreadPoolAsynchronousRunner $ PoolThread. run (ThreadPoolAsynchronousRunner. java: 696)
Caused by: com. mysql. cj. core. exceptions. invalidConnectionAttributeException: The server time zone value 'is unrecognized or represents more than one time zone. you must configure either the server or JDBC driver (via the serverTimezone configuration property) to use a more specifc time zone value if you want to utilize time zone support.
At sun. reflect. GeneratedConstructorAccessor28.newInstance (Unknown Source)
At sun. reflect. delegatingconstruct%cessorimpl. newInstance (delegatingconstruct%cessorimpl. java: 45)
At java. lang. reflect. Constructor. newInstance (Constructor. java: 423)
At com. mysql. cj. core. exceptions. ExceptionFactory. createException (ExceptionFactory. java: 54)
At com. mysql. cj. core. exceptions. ExceptionFactory. createException (ExceptionFactory. java: 73)
At com. mysql. cj. jdbc. util. TimeUtil. getCanonicalTimezone (TimeUtil. java: 118)
At com. mysql. cj. mysqla. MysqlaSession. configureTimezone (MysqlaSession. java: 293)
At com. mysql. cj. jdbc. ConnectionImpl. initializePropsFromServer (ConnectionImpl. java: 2399)
At com. mysql. cj. jdbc. ConnectionImpl. connectOneTryOnly (ConnectionImpl. java: 1739)
At com. mysql. cj. jdbc. ConnectionImpl. createNewIO (ConnectionImpl. java: 1596)
... 12 more
[WARNING] Having failed to acquire a resource, com. mchange. v2.resourcepool. basicResourcePool @ 1e877aa is interrupting all Threads waiting on a resource to check out. will try again in response to new client requests.
[WARNING] com. mchange. v2.resourcepool. BasicResourcePool $ ScatteredAcquireTask @ 1dd8d61 -- 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 (30). Last acquisition attempt exception:
Java. SQL. SQLException: The server time zone value 'is unrecognized or represents more than one time zone. you must configure either the server or JDBC driver (via the serverTimezone configuration property) to use a more specifc time zone value if you want to utilize time zone support.
At com. mysql. cj. jdbc. exceptions. SQLError. createSQLException (SQLError. java: 545)
At com. mysql. cj. jdbc. exceptions. SQLError. createSQLException (SQLError. java: 513)
At com. mysql. cj. jdbc. exceptions. SQLError. createSQLException (SQLError. java: 505)
At com. mysql. cj. jdbc. exceptions. SQLError. createSQLException (SQLError. java: 479)
At com. mysql. cj. jdbc. exceptions. SQLError. createSQLException (SQLError. java: 489)
At com. mysql. cj. jdbc. exceptions. SQLExceptionsMapping. translateException (SQLExceptionsMapping. java: 69)
At com. mysql. cj. jdbc. ConnectionImpl. createNewIO (ConnectionImpl. java: 1606)
At com. mysql. cj. jdbc. ConnectionImpl. <init> (ConnectionImpl. java: 633)
At com. mysql. cj. jdbc. ConnectionImpl. getInstance (ConnectionImpl. java: 347)
At com. mysql. cj. jdbc. NonRegisteringDriver. connect (NonRegisteringDriver. java: 219)
At com. mchange. v2.c3p0. DriverManagerDataSource. getConnection (DriverManagerDataSource. java: 175)
At com. mchange. v2.c3p0. WrapperConnectionPoolDataSource. getPooledConnection (WrapperConnectionPoolDataSource. java: 220)
At com. mchange. v2.c3p0. WrapperConnectionPoolDataSource. getPooledConnection (WrapperConnectionPoolDataSource. java: 206)
At com. mchange. v2.c3p0. impl. C3P0PooledConnectionPool $ 1PooledConnectionResourcePoolManager. acquireResource (C3P0PooledConnectionPool. java: 203)
At com. mchange. v2.resourcepool. BasicResourcePool. doAcquire (BasicResourcePool. java: 1138)
At com. mchange. v2.resourcepool. BasicResourcePool. doAcquireAndDecrementPendingAcquiresWithinLockOnSuccess (BasicResourcePool. java: 1125)
At com. mchange. v2.resourcepool. BasicResourcePool. access $700 (BasicResourcePool. java: 44)
At com. mchange. v2.resourcepool. BasicResourcePool $ ScatteredAcquireTask. run (BasicResourcePool. java: 1870)
At com. mchange. v2.async. ThreadPoolAsynchronousRunner $ PoolThread. run (ThreadPoolAsynchronousRunner. java: 696)
Caused by: com. mysql. cj. core. exceptions. invalidConnectionAttributeException: The server time zone value 'is unrecognized or represents more than one time zone. you must configure either the server or JDBC driver (via the serverTimezone configuration property) to use a more specifc time zone value if you want to utilize time zone support.
At sun. reflect. GeneratedConstructorAccessor28.newInstance (Unknown Source)
At sun. reflect. delegatingconstruct%cessorimpl. newInstance (delegatingconstruct%cessorimpl. java: 45)
At java. lang. reflect. Constructor. newInstance (Constructor. java: 423)
At com. mysql. cj. core. exceptions. ExceptionFactory. createException (ExceptionFactory. java: 54)
At com. mysql. cj. core. exceptions. ExceptionFactory. createException (ExceptionFactory. java: 73)
At com. mysql. cj. jdbc. util. TimeUtil. getCanonicalTimezone (TimeUtil. java: 118)
At com. mysql. cj. mysqla. MysqlaSession. configureTimezone (MysqlaSession. java: 293)
At com. mysql. cj. jdbc. ConnectionImpl. initializePropsFromServer (ConnectionImpl. java: 2399)
At com. mysql. cj. jdbc. ConnectionImpl. connectOneTryOnly (ConnectionImpl. java: 1739)
At com. mysql. cj. jdbc. ConnectionImpl. createNewIO (ConnectionImpl. java: 1596)
... 12 more
[WARNING] Having failed to acquire a resource, com. mchange. v2.resourcepool. basicResourcePool @ 1e877aa is interrupting all Threads waiting on a resource to check out. will try again in response to new client requests.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.