Hello everyone! can someone help me how to solve this error below? I tried a lot and nothing.
Error:
12-Dec-2017 20:27:27.908 INFO [http-nio-8084-exec-6] org.springframework.web.servlet.FrameworkServlet.initServletBean FrameworkServlet 'dispatcher': initialization completed in 1266 ms
12-Dec-2017 20:27:27.923 INFO [http-nio-8084-exec-6] org.apache.catalina.core.StandardContext.reload Reloading Context with name [/Head2Head] is completed
12-Dec-2017 20:27:39.276 INFO [MLog-Init-Reporter] com.mchange.v2.log.MLog. MLog clients using java 1.4+ standard logging.
12-Dec-2017 20:27:39.338 INFO [http-nio-8084-exec-2] com.mchange.v2.c3p0.C3P0Registry. Initializing c3p0-0.9.5.2 [built 08-December-2015 22:06:04 -0800; debug? true; trace: 10]
12-Dec-2017 20:27:39.448 INFO [http-nio-8084-exec-2] com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource. Initializing c3p0 pool... com.mchange.v2.c3p0.ComboPooledDataSource [ acquireIncrement -> 5, acquireRetryAttempts -> 30, acquireRetryDelay -> 1000, autoCommitOnClose -> false, automaticTestTable -> null, breakAfterAcquireFailure -> false, checkoutTimeout -> 0, connectionCustomizerClassName -> null, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, contextClassLoaderSource -> caller, dataSourceName -> 1hge5tw9sldokl6qlaopl|1f977041, debugUnreturnedConnectionStackTraces -> false, description -> null, driverClass -> com.mysql.jdbc.Driver, extensions -> {}, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, forceSynchronousCheckins -> false, forceUseNamedDriverClass -> false, identityToken -> 1hge5tw9sldokl6qlaopl|1f977041, idleConnectionTestPeriod -> 0, initialPoolSize -> 3, jdbcUrl -> jdbc:mysql://*****************.sa-east-1.rds.amazonaws.com:3306/nadalspringmvc?autoReconnect=true&useSSL=false, maxAdministrativeTaskTime -> 0, maxConnectionAge -> 0, maxIdleTime -> 0, maxIdleTimeExcessConnections -> 0, maxPoolSize -> 100, maxStatements -> 0, maxStatementsPerConnection -> 0, minPoolSize -> 10, numHelperThreads -> 3, preferredTestQuery -> null, privilegeSpawnedThreads -> false, properties -> {user=******, password=******}, propertyCycle -> 0, statementCacheNumDeferredCloseThreads -> 0, testConnectionOnCheckin -> true, testConnectionOnCheckout -> false, unreturnedConnectionTimeout -> 0, userOverrides -> {}, usesTraditionalReflectiveProxies -> false ]
12-Dec-2017 20:27:39.465 WARNING [http-nio-8084-exec-2] com.mchange.v2.resourcepool.BasicResourcePool. Bad pool size config, start 3 < min 10. Using 10 as start.
Code:
package br.com.head2head.dao;
import java.beans.PropertyVetoException;
import javax.sql.DataSource;
import com.mchange.v2.c3p0.ComboPooledDataSource;
public class ConnectionPool {
private static final String DB_USERNAME = "********";
private static final String DB_PASSWORD = "********";
private static final String DB_URL = "jdbc:mysql://********.sa-east-1.rds.amazonaws.com:3306/********?autoReconnect=true&useSSL=false";
private static final String DB_DRIVER_CLASS = "com.mysql.jdbc.Driver";
private static ComboPooledDataSource dataSource;
static {
try {
dataSource = new ComboPooledDataSource();
dataSource.setDriverClass(DB_DRIVER_CLASS);
dataSource.setJdbcUrl(DB_URL);
dataSource.setUser(DB_USERNAME);
dataSource.setPassword(DB_PASSWORD);
dataSource.setMinPoolSize(100);
dataSource.setMaxPoolSize(1000);
dataSource.setAcquireIncrement(5);
} catch (PropertyVetoException e) {
e.printStackTrace();
}
}
public static DataSource getDataSource() {
return dataSource;
}
}