Olá,
Criei um site a nível de aprendizado utilizando javaweb, e hospedei ele no jelastic, até ai tudo funcionando normal, consigo acessar a tela inicial de login, porém quando tento fazer login nada acontece, percebi que não esta conseguindo conectar com o banco de dados (phpMyAdmin).
No localhost (workbench) ele conecta corretamente.
abaixo a mensagem que aparece no catalina:
02-Jun-2019 18:29:36.660 WARNING [C3P0PooledConnectionPoolManager[identityToken->2vsjd1a363uyrbxnmwjj|2407b1f]-HelperThread-#0] com.mchange.v2.resourcepool.BasicResourcePool. com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@64454606 -- 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: Access denied for user 'root'@'10.100.24.5' (using password: YES)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:959)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3870)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3806)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:871)
at com.mysql.jdbc.MysqlIO.proceedHandshakeWithPluggableAuthentication(MysqlIO.java:1686)
at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1207)
at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2254)
at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2285)
at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2084)
at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:795)
at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:44)
at jdk.internal.reflect.GeneratedConstructorAccessor12.newInstance(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:500)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:481)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:404)
at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:400)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:327)
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)
02-Jun-2019 18:29:36.661 WARNING [C3P0PooledConnectionPoolManager[identityToken->2vsjd1a363uyrbxnmwjj|2407b1f]-HelperThread-#0] com.mchange.v2.resourcepool.BasicResourcePool. Having failed to acquire a resource, com.mchange.v2.resourcepool.BasicResourcePool@5d3b92e6 is interrupting all Threads waiting on a resource to check out. Will try again in response to new client requests.
E a classe de conexção com o banco de dados:
import com.mchange.v2.c3p0.ComboPooledDataSource;
public class ConnectionPool {
private ComboPooledDataSource dataSource;
public ConnectionPool() throws PropertyVetoException{
ComboPooledDataSource pool = new ComboPooledDataSource();
pool.setDriverClass("com.mysql.jdbc.Driver");
pool.setJdbcUrl("jdbc:mysql://node32749-hidrosistemas-portal.jelastic.saveincloud.net/hidro_sistemas_portal");
pool.setUser("root");
pool.setPassword("SENHA");
pool.setMinPoolSize(1);
pool.setAcquireIncrement(5);
pool.setMaxPoolSize(20);
this.dataSource = pool;
}
public Connection getConnetion() throws SQLException{
Connection con = dataSource.getConnection();
return con;
}
}
Já pesquisei bastante sobre o assunto e não encontrei nada que pudesse me ajudar.