Olá, pessoal!
Sou novo aqui. Espero que me aceitem bem!
Estou tentando rodar um projeto JSF no Glassfish5, porém ao startar o servidor através do modo debug do IntelliJ, estou recebendo um ERROR: Initializing Ciphers]], e após alguns segundos (30 ou 60. É um timeout), vem um erro do Postgres dizendo que falhou ao entrar com meu usuário.
O bizarro disso tudo é que ele está tentando usar o usuário do meu computador, e não o definido no persistence.xml.
Erro:
ERROR: Initializing Ciphers]]
[2020-11-17T00:21:54.796-0300] [glassfish 5.0] [WARNING] [] [com.mchange.v2.resourcepool.BasicResourcePool] [tid: _ThreadID=148 _ThreadName=C3P0PooledConnectionPoolManager[identityToken->1hgfcwhad1mvtfjpkspix|4a1dc811]-HelperThread-#2] [timeMillis: 1605583314796] [levelValue: 900] [[
com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@7675297f – 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:
[2020-11-17T00:21:54.796-0300] [glassfish 5.0] [WARNING] [] [com.mchange.v2.resourcepool.BasicResourcePool] [tid: _ThreadID=148 _ThreadName=C3P0PooledConnectionPoolManager[identityToken->1hgfcwhad1mvtfjpkspix|4a1dc811]-HelperThread-#2] [timeMillis: 1605583314796] [levelValue: 900] [[
Having failed to acquire a resource, com.mchange.v2.resourcepool.BasicResourcePool@a7e9df4 is interrupting all Threads waiting on a resource to check out. Will try again in response to new client requests.]]org.postgresql.util.PSQLException: FATAL: password authentication failed for user “Asdra”
at org.postgresql.core.v3.ConnectionFactoryImpl.doAuthentication(ConnectionFactoryImpl.java:525)
at org.postgresql.core.v3.ConnectionFactoryImpl.tryConnect(ConnectionFactoryImpl.java:146)
at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:197)
at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:49)
at org.postgresql.jdbc.PgConnection.(PgConnection.java:211)
at org.postgresql.Driver.makeConnection(Driver.java:459)
at org.postgresql.Driver.connect(Driver.java:261)
at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:161)
at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:161)
at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:147)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:202)
at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1176)
at com.mchange.v2.resourcepool.BasicResourcePool.doAcquireAndDecrementPendingAcquiresWithinLockOnSuccess(BasicResourcePool.java:1163)
at com.mchange.v2.resourcepool.BasicResourcePool.access$700(BasicResourcePool.java:44)
at com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask.run(BasicResourcePool.java:1908)
at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:696)
]][2020-11-17T00:21:54.818-0300] [glassfish 5.0] [WARN] [] [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] [tid: _ThreadID=46 _ThreadName=http-listener-1(2)] [timeMillis: 1605583314818] [levelValue: 900] [[
[2020-11-17T00:21:54.886-0300] [glassfish 5.0] [WARNING] [] [com.mchange.v2.resourcepool.BasicResourcePool] [tid: _ThreadID=148 _ThreadName=C3P0PooledConnectionPoolManager[identityToken->1hgfcwhad1mvtfjpkspix|4a1dc811]-HelperThread-#2] [timeMillis: 1605583314886] [levelValue: 900] [[
com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@7a49c224 – 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:
[2020-11-17T00:21:54.886-0300] [glassfish 5.0] [WARNING] [] [com.mchange.v2.resourcepool.BasicResourcePool] [tid: _ThreadID=147 _ThreadName=C3P0PooledConnectionPoolManager[identityToken->1hgfcwhad1mvtfjpkspix|4a1dc811]-HelperThread-#1] [timeMillis: 1605583314886] [levelValue: 900] [[
com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@592f7eea – 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:
[2020-11-17T00:21:54.886-0300] [glassfish 5.0] [WARNING] [] [com.mchange.v2.resourcepool.BasicResourcePool] [tid: _ThreadID=148 _ThreadName=C3P0PooledConnectionPoolManager[identityToken->1hgfcwhad1mvtfjpkspix|4a1dc811]-HelperThread-#2] [timeMillis: 1605583314886] [levelValue: 900] [[
Having failed to acquire a resource, com.mchange.v2.resourcepool.BasicResourcePool@a7e9df4 is interrupting all Threads waiting on a resource to check out. Will try again in response to new client requests.]][2020-11-17T00:21:54.886-0300] [glassfish 5.0] [WARNING] [] [com.mchange.v2.resourcepool.BasicResourcePool] [tid: _ThreadID=147 _ThreadName=C3P0PooledConnectionPoolManager[identityToken->1hgfcwhad1mvtfjpkspix|4a1dc811]-HelperThread-#1] [timeMillis: 1605583314886] [levelValue: 900] [[
Having failed to acquire a resource, com.mchange.v2.resourcepool.BasicResourcePool@a7e9df4 is interrupting all Threads waiting on a resource to check out. Will try again in response to new client requests.]]SQL Error: 0, SQLState: null]]
[2020-11-17T00:21:54.819-0300] [glassfish 5.0] [ERROR] [] [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] [tid: _ThreadID=46 _ThreadName=http-listener-1(2)] [timeMillis: 1605583314819] [levelValue: 1000] [[
Connections could not be acquired from the underlying database!]]org.postgresql.util.PSQLException: FATAL: password authentication failed for user “Asdra”
at org.postgresql.core.v3.ConnectionFactoryImpl.doAuthentication(ConnectionFactoryImpl.java:525)
at org.postgresql.core.v3.ConnectionFactoryImpl.tryConnect(ConnectionFactoryImpl.java:146)
at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:197)
at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:49)
at org.postgresql.jdbc.PgConnection.(PgConnection.java:211)
at org.postgresql.Driver.makeConnection(Driver.java:459)
at org.postgresql.Driver.connect(Driver.java:261)
at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:161)
at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:161)
at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:147)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:202)
at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1176)
at com.mchange.v2.resourcepool.BasicResourcePool.doAcquireAndDecrementPendingAcquiresWithinLockOnSuccess(BasicResourcePool.java:1163)
at com.mchange.v2.resourcepool.BasicResourcePool.access$700(BasicResourcePool.java:44)
at com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask.run(BasicResourcePool.java:1908)
at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:696)
]]
persistence.xml:
<persistence-unit name="projeto">
<!-- JPA (Hibernate) -->
<provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
<class>projeto.projeto.entity.Equipe</class>
<class>projeto.projeto.entity.Role</class>
<class>projeto.projeto.entity.Sistema</class>
<class>projeto.projeto.entity.Tag</class>
<class>projeto.projeto.entity.Unidade</class>
<class>projeto.projeto.entity.Usuario</class>
<class>projeto.projeto.entity.Chamado</class>
<class>projeto.projeto.entity.Tramite</class>
<class>projeto.projeto.entity.Anexo</class>
<class>projeto.projeto.entity.Perfil</class>
<class>projeto.projeto.entity.Url</class>
<class>projeto.projeto.entity.Filtro</class>
<properties>
<!-- JDBC -->
<property name="javax.persistence.jdbc.driver" value="org.postgresql.Driver" />
<property name="javax.persistence.jdbc.url" value="jdbc:postgresql://localhost/projeto" />
<property name="javax.persistence.jdbc.usuario" value="postgres" />
<property name="javax.persistence.jdbc.password" value="postgres" />
<!-- Hibernate -->
<property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQL95Dialect" />
<property name="hibernate.hbm2ddl.auto" value="update" />
<property name="hibernate.show_sql" value="true" />
<property name="hibernate.format_sql" value="true" />
<property name="hibernate.temp.use_jdbc_metadata_defaults" value="false" />
<property name="hibernate.jdbc.use_get_generated_keys" value="true" />
<property name="hibernate.jdbc.use_scrollable_resultset" value="true" />
<property name="hibernate.connection.autocommit" value="true"/>
<!-- C3P0 -->
<property name="connection.provider_class" value="org.hibernate.connection.C3P0ConnectionProvider"/>
<property name="hibernate.c3p0.min_size" value="10" />
<property name="hibernate.c3p0.max_size" value="20" />
<property name="hibernate.c3p0.acquire_increment" value="1" />
<property name="hibernate.c3p0.idle_test_period" value="3000" />
<property name="hibernate.c3p0.max_statements" value="1" />
<property name="hibernate.c3p0.timeout" value="1800" />
</properties>
</persistence-unit>
</persistence>
Se for útil, meu pom.xml:
<?xml version="1.0" encoding="UTF-8"?>
4.0.0
<groupId>projeto.projeto</groupId>
<artifactId>projeto</artifactId>
<packaging>war</packaging>
<version>1.0</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.source>1.8</maven.compiler.source>
</properties>
<dependencies>
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
<version>8.0</version>
</dependency>
<dependency>
<groupId>org.glassfish</groupId>
<artifactId>javax.faces</artifactId>
<version>2.4.0</version>
</dependency>
<dependency>
<groupId>javax.enterprise</groupId>
<artifactId>cdi-api</artifactId>
<version>2.0</version>
</dependency>
<dependency>
<groupId>org.jboss.weld.servlet</groupId>
<artifactId>weld-servlet</artifactId>
<version>3.0.0.Alpha1</version>
</dependency>
<dependency>
<groupId>org.jboss</groupId>
<artifactId>jandex</artifactId>
<version>2.1.3.Final</version>
</dependency>
<dependency>
<groupId>org.webjars</groupId>
<artifactId>font-awesome</artifactId>
<version>5.13.0</version>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>42.2.11</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>5.4.13.Final</version>
</dependency>
<dependency>
<groupId>org.primefaces</groupId>
<artifactId>primefaces</artifactId>
<version>8.0</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.10</version>
</dependency>
<dependency>
<groupId>org.hibernate.orm</groupId>
<artifactId>hibernate-c3p0</artifactId>
<version>6.0.0.Alpha5</version>
</dependency>
<dependency>
<groupId>com.mchange</groupId>
<artifactId>c3p0</artifactId>
<version>0.9.5.5</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
</dependency>
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
<version>2.1</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>8</source>
<target>8</target>
</configuration>
</plugin>
</plugins>
</build>