HikariPool-1 - Cannot acquire connection from data source in mockito - java

I am performing unit tests using mockito to return a dataSource using HikariDataSource,
but inform that you cannot get the connection to the network.
I understand that being a mock it is not necessary to hit the correct URL
07:24:50.913 [main] DEBUG com.zaxxer.hikari.HikariConfig - Driver class oracle.jdbc.driver.OracleDriver found in Thread context class loader sun.misc.Launcher$AppClassLoader#7106e68e
07:24:50.982 [main] WARN com.zaxxer.hikari.HikariConfig - HikariPool-1 - maxLifetime is less than 30000ms, setting to default 1800000ms.
07:24:50.982 [main] WARN com.zaxxer.hikari.HikariConfig - HikariPool-1 - idleTimeout has been set but has no effect because the pool is operating as a fixed size pool.
07:24:50.982 [main] DEBUG com.zaxxer.hikari.HikariConfig - HikariPool-1 - configuration:
07:24:50.987 [main] DEBUG com.zaxxer.hikari.HikariConfig - allowPoolSuspension.............false
07:24:50.988 [main] DEBUG com.zaxxer.hikari.HikariConfig - autoCommit......................true
07:24:50.988 [main] DEBUG com.zaxxer.hikari.HikariConfig - catalog.........................none
07:24:50.988 [main] DEBUG com.zaxxer.hikari.HikariConfig - connectionInitSql...............none
07:24:50.988 [main] DEBUG com.zaxxer.hikari.HikariConfig - connectionTestQuery.............none
07:24:50.988 [main] DEBUG com.zaxxer.hikari.HikariConfig - connectionTimeout...............20000
07:24:50.988 [main] DEBUG com.zaxxer.hikari.HikariConfig - dataSource......................none
07:24:50.988 [main] DEBUG com.zaxxer.hikari.HikariConfig - dataSourceClassName.............none
07:24:50.988 [main] DEBUG com.zaxxer.hikari.HikariConfig - dataSourceJNDI..................none
07:24:50.989 [main] DEBUG com.zaxxer.hikari.HikariConfig - dataSourceProperties............{password=<masked>}
07:24:50.989 [main] DEBUG com.zaxxer.hikari.HikariConfig - driverClassName................."oracle.jdbc.driver.OracleDriver"
07:24:50.989 [main] DEBUG com.zaxxer.hikari.HikariConfig - exceptionOverrideClassName......none
07:24:50.989 [main] DEBUG com.zaxxer.hikari.HikariConfig - healthCheckProperties...........{}
07:24:50.989 [main] DEBUG com.zaxxer.hikari.HikariConfig - healthCheckRegistry.............none
07:24:50.989 [main] DEBUG com.zaxxer.hikari.HikariConfig - idleTimeout.....................10000
07:24:50.989 [main] DEBUG com.zaxxer.hikari.HikariConfig - initializationFailTimeout.......1
07:24:50.990 [main] DEBUG com.zaxxer.hikari.HikariConfig - isolateInternalQueries..........false
07:24:50.990 [main] DEBUG com.zaxxer.hikari.HikariConfig - jdbcUrl.........................jdbc:oracle:thin:#192.168.55.147:1522:swd126
07:24:50.990 [main] DEBUG com.zaxxer.hikari.HikariConfig - leakDetectionThreshold..........0
07:24:50.990 [main] DEBUG com.zaxxer.hikari.HikariConfig - maxLifetime.....................1800000
07:24:50.990 [main] DEBUG com.zaxxer.hikari.HikariConfig - maximumPoolSize.................10
07:24:50.990 [main] DEBUG com.zaxxer.hikari.HikariConfig - metricRegistry..................none
07:24:50.990 [main] DEBUG com.zaxxer.hikari.HikariConfig - metricsTrackerFactory...........none
07:24:50.990 [main] DEBUG com.zaxxer.hikari.HikariConfig - minimumIdle.....................10
07:24:50.990 [main] DEBUG com.zaxxer.hikari.HikariConfig - password........................<masked>
07:24:50.990 [main] DEBUG com.zaxxer.hikari.HikariConfig - poolName........................"HikariPool-1"
07:24:50.990 [main] DEBUG com.zaxxer.hikari.HikariConfig - readOnly........................false
07:24:50.991 [main] DEBUG com.zaxxer.hikari.HikariConfig - registerMbeans..................false
07:24:50.991 [main] DEBUG com.zaxxer.hikari.HikariConfig - scheduledExecutor...............none
07:24:50.991 [main] DEBUG com.zaxxer.hikari.HikariConfig - schema..........................none
07:24:50.991 [main] DEBUG com.zaxxer.hikari.HikariConfig - threadFactory...................internal
07:24:50.991 [main] DEBUG com.zaxxer.hikari.HikariConfig - transactionIsolation............default
07:24:50.991 [main] DEBUG com.zaxxer.hikari.HikariConfig - username........................"teste"
07:24:50.991 [main] DEBUG com.zaxxer.hikari.HikariConfig - validationTimeout...............5000
07:24:50.992 [main] INFO com.zaxxer.hikari.HikariDataSource - HikariPool-1 - Starting...
07:24:50.998 [main] WARN com.zaxxer.hikari.util.DriverDataSource - Registered driver with driverClassName=oracle.jdbc.driver.OracleDriver was not found, trying direct instantiation.
07:24:50.999 [main] DEBUG com.zaxxer.hikari.util.DriverDataSource - Driver class oracle.jdbc.driver.OracleDriver found in Thread context class loader sun.misc.Launcher$AppClassLoader#7106e68e
07:24:54.084 [main] DEBUG com.zaxxer.hikari.pool.PoolBase - HikariPool-1 - Failed to create/setup connection: IO Error: The Network Adapter could not establish the connection
07:24:54.086 [main] DEBUG com.zaxxer.hikari.pool.HikariPool - HikariPool-1 - Cannot acquire connection from data source
java.sql.SQLRecoverableException: IO Error: The Network Adapter could not establish the connection
Caused by: oracle.net.ns.NetException: The Network Adapter could not establish the connection
at oracle.net.nt.ConnStrategy.execute(ConnStrategy.java:445)
at oracle.net.resolver.AddrResolution.resolveAndExecute(AddrResolution.java:464)
at oracle.net.ns.NSProtocol.establishConnection(NSProtocol.java:594)
at oracle.net.ns.NSProtocol.connect(NSProtocol.java:229)
at oracle.jdbc.driver.T4CConnection.connect(T4CConnection.java:1360)
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:486)
... 78 common frames omitted
#Component
public class ConfigDataSource {
#Autowired
private Properties properties;
public DataSource getDataSource(String url, String username, String password) {
DataSource dataSource = null;
try {
HikariConfig ds = new HikariConfig();
ds.setJdbcUrl(url);
ds.setUsername(username);
ds.setPassword(password);
ds.setDriverClassName(properties.getDriveClassName());
ds.setConnectionTimeout(properties.getConnectionTimeout());
ds.setMinimumIdle(properties.getMinimumIdle());
ds.setMaximumPoolSize(properties.getMaximumPoolSize());
ds.setIdleTimeout(properties.getIdleTimeout());
ds.setMaxLifetime(properties.getMaxLifetime());
dataSource = new HikariDataSource(ds);
} catch (Exception e) {
System.err.println("Error connecting to the database: " + e.getMessage());
}
return dataSource;
}
}
Mockito:
#ExtendWith(MockitoExtension.class)
public class ConfigDataSourceTest {
#Mock
private Properties properties;
#InjectMocks
private ConfigDataSource configDataSource;
#Test
public void configDataSourceTest() {
String jdbcUrl = "jdbc:oracle:thin:teste:swd001";
String userName = "teste";
String password = "teste";
String divreClassName = "oracle.jdbc.driver.OracleDriver";
Integer connectionTimeout = 20000;
Integer minimumIdle = 100;
Integer maximumPoolSize = 10;
Integer idleTimeout = 10000;
Integer maxLifetime = 1000;
when(properties.getDriveClassName()).thenReturn(divreClassName);
when(properties.getConnectionTimeout()).thenReturn(connectionTimeout);
when(properties.getMinimumIdle()).thenReturn(minimumIdle);
when(properties.getMaximumPoolSize()).thenReturn(maximumPoolSize);
when(properties.getIdleTimeout()).thenReturn(idleTimeout);
when(properties.getMaxLifetime()).thenReturn(maxLifetime);
DataSource result = configDataSource.getDataSource(jdbcUrl, userName, password);
assertNotNull(result);
}
}

Related

Java app on Kubernetes still uses broken connection after Connection reset by peer using HikariCP

After trying to figure out whats wrong with our app, I have decided to look here for some help.
We have a Java app which uses below packages for HikariCP database pool
+--- com.custom.gwtext:gwtext-server
| +--- org.hibernate:hibernate-hikaricp:5.4.6.Final
| | +--- org.hibernate:hibernate-core:5.4.6.Final (*)
| | \--- com.zaxxer:HikariCP:3.2.0 -> 3.3.0
| | \--- org.slf4j:slf4j-api:1.7.25 -> 1.7.36
| +--- com.zaxxer:HikariCP:3.3.0 (*)
The issue is that we are currently trying to migrate to Kubernetes and we started to see a lot of java.sql.SQLException: Connection is closed errors after application is running for several hours. After enabling Hikari DEBUG log and adding leakDetectionThreshold we started to notice a few things.
This is the configuration for HikariCP
00:06:05.521 [main] DEBUG com.zaxxer.hikari.HikariConfig - HikariPool-2 - configuration:
00:06:05.522 [main] DEBUG com.zaxxer.hikari.HikariConfig - allowPoolSuspension.............false
00:06:05.523 [main] DEBUG com.zaxxer.hikari.HikariConfig - autoCommit......................false
00:06:05.523 [main] DEBUG com.zaxxer.hikari.HikariConfig - catalog.........................none
00:06:05.523 [main] DEBUG com.zaxxer.hikari.HikariConfig - connectionInitSql...............none
00:06:05.523 [main] DEBUG com.zaxxer.hikari.HikariConfig - connectionTestQuery.............none
00:06:05.523 [main] DEBUG com.zaxxer.hikari.HikariConfig - connectionTimeout...............30000
00:06:05.523 [main] DEBUG com.zaxxer.hikari.HikariConfig - dataSource......................none
00:06:05.524 [main] DEBUG com.zaxxer.hikari.HikariConfig - dataSourceClassName.............none
00:06:05.524 [main] DEBUG com.zaxxer.hikari.HikariConfig - dataSourceJNDI..................none
00:06:05.524 [main] DEBUG com.zaxxer.hikari.HikariConfig - dataSourceProperties............{password=<masked>}
00:06:05.524 [main] DEBUG com.zaxxer.hikari.HikariConfig - driverClassName................."oracle.jdbc.OracleDriver"
00:06:05.524 [main] DEBUG com.zaxxer.hikari.HikariConfig - healthCheckProperties...........{}
00:06:05.524 [main] DEBUG com.zaxxer.hikari.HikariConfig - healthCheckRegistry.............none
00:06:05.525 [main] DEBUG com.zaxxer.hikari.HikariConfig - idleTimeout.....................600000
00:06:05.525 [main] DEBUG com.zaxxer.hikari.HikariConfig - initializationFailTimeout.......1
00:06:05.525 [main] DEBUG com.zaxxer.hikari.HikariConfig - isolateInternalQueries..........false
00:06:05.525 [main] DEBUG com.zaxxer.hikari.HikariConfig - jdbcUrl.........................jdbc:oracle:thin:#1.1.1.1:1521:test
00:06:05.525 [main] DEBUG com.zaxxer.hikari.HikariConfig - leakDetectionThreshold..........200000
00:06:05.525 [main] DEBUG com.zaxxer.hikari.HikariConfig - maxLifetime.....................18000000
00:06:05.526 [main] DEBUG com.zaxxer.hikari.HikariConfig - maximumPoolSize.................90
00:06:05.526 [main] DEBUG com.zaxxer.hikari.HikariConfig - metricRegistry..................none
00:06:05.526 [main] DEBUG com.zaxxer.hikari.HikariConfig - metricsTrackerFactory...........none
00:06:05.526 [main] DEBUG com.zaxxer.hikari.HikariConfig - minimumIdle.....................15
00:06:05.526 [main] DEBUG com.zaxxer.hikari.HikariConfig - password........................<masked>
00:06:05.526 [main] DEBUG com.zaxxer.hikari.HikariConfig - poolName........................"HikariPool-2"
00:06:05.527 [main] DEBUG com.zaxxer.hikari.HikariConfig - readOnly........................false
00:06:05.527 [main] DEBUG com.zaxxer.hikari.HikariConfig - registerMbeans..................false
00:06:05.527 [main] DEBUG com.zaxxer.hikari.HikariConfig - scheduledExecutor...............none
00:06:05.527 [main] DEBUG com.zaxxer.hikari.HikariConfig - schema..........................none
00:06:05.527 [main] DEBUG com.zaxxer.hikari.HikariConfig - threadFactory...................internal
00:06:05.527 [main] DEBUG com.zaxxer.hikari.HikariConfig - transactionIsolation............default
00:06:05.528 [main] DEBUG com.zaxxer.hikari.HikariConfig - username........................"user"
00:06:05.528 [main] DEBUG com.zaxxer.hikari.HikariConfig - validationTimeout...............5000
After starting up the Java app and logging in with the user, after some minutes (probably the leakDetectionThreshold) we notice below log entry, which says that there is 2 leaks right away
[HikariPool-2 housekeeper] WARN com.zaxxer.hikari.pool.ProxyLeakTask - Connection leak detection triggered for oracle.jdbc.driver.T4CConnection#5ae99303 on thread pool-10-thread-1, stack trace follows
java.lang.Exception: Apparent connection leak detected
at com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:100)
at org.hibernate.engine.jdbc.connections.internal.DatasourceConnectionProviderImpl.getConnection(DatasourceConnectionProviderImpl.java:122)
at org.hibernate.internal.NonContextualJdbcConnectionAccess.obtainConnection(NonContextualJdbcConnectionAccess.java:38)
at org.hibernate.resource.jdbc.internal.LogicalConnectionManagedImpl.acquireConnectionIfNeeded(LogicalConnectionManagedImpl.java:104)
at org.hibernate.resource.jdbc.internal.LogicalConnectionManagedImpl.getPhysicalConnection(LogicalConnectionManagedImpl.java:134)
at org.hibernate.resource.jdbc.internal.LogicalConnectionManagedImpl.getConnectionForTransactionManagement(LogicalConnectionManagedImpl.java:250)
at org.hibernate.resource.jdbc.internal.LogicalConnectionManagedImpl.begin(LogicalConnectionManagedImpl.java:258)
at org.hibernate.resource.transaction.backend.jdbc.internal.JdbcResourceLocalTransactionCoordinatorImpl$TransactionDriverControlImpl.begin(JdbcResourceLocalTransactionCoordinatorImpl.java:246)
at org.hibernate.engine.transaction.internal.TransactionImpl.begin(TransactionImpl.java:83)
at org.hibernate.internal.AbstractSharedSessionContract.beginTransaction(AbstractSharedSessionContract.java:467)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.hibernate.context.internal.ThreadLocalSessionContext$TransactionProtectionWrapper.invoke(ThreadLocalSessionContext.java:350)
at com.sun.proxy.$Proxy326.beginTransaction(Unknown Source)
at com.custom.gwtext.server.utils.HibernateUtilImpl.startTransaction(HibernateUtilImpl.java:335)
at com.custom.gwtext.server.utils.HibernateUtilImpl.startTransactionIfNeeded(HibernateUtilImpl.java:330)
at com.custom.gwtext.server.utils.HibernateUtilImpl.getSession(HibernateUtilImpl.java:70)
at com.custom.pins.server.idgeneration.DatabaseSequenceIdPoolDataUtil.reserveIdBatch(DatabaseSequenceIdPoolDataUtil.java:29)
at com.custom.pins.server.idgeneration.DatabaseSequenceIdPool.reserveIdsInDatabase(DatabaseSequenceIdPool.java:106)
at com.custom.pins.server.idgeneration.DatabaseSequenceIdPool.access$300(DatabaseSequenceIdPool.java:24)
at com.custom.pins.server.idgeneration.DatabaseSequenceIdPool$ReserveIdsTask.run(DatabaseSequenceIdPool.java:125)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)
and a few minutes later second one
[HikariPool-2 housekeeper] WARN com.zaxxer.hikari.pool.ProxyLeakTask - Connection leak detection triggered for oracle.jdbc.driver.T4CConnection#7b911a8f on thread pool-6-thread-1, stack trace follows
java.lang.Exception: Apparent connection leak detected
at com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:100)
at org.hibernate.engine.jdbc.connections.internal.DatasourceConnectionProviderImpl.getConnection(DatasourceConnectionProviderImpl.java:122)
at org.hibernate.internal.NonContextualJdbcConnectionAccess.obtainConnection(NonContextualJdbcConnectionAccess.java:38)
at org.hibernate.resource.jdbc.internal.LogicalConnectionManagedImpl.acquireConnectionIfNeeded(LogicalConnectionManagedImpl.java:104)
at org.hibernate.resource.jdbc.internal.LogicalConnectionManagedImpl.getPhysicalConnection(LogicalConnectionManagedImpl.java:134)
at org.hibernate.resource.jdbc.internal.LogicalConnectionManagedImpl.getConnectionForTransactionManagement(LogicalConnectionManagedImpl.java:250)
at org.hibernate.resource.jdbc.internal.LogicalConnectionManagedImpl.begin(LogicalConnectionManagedImpl.java:258)
at org.hibernate.resource.transaction.backend.jdbc.internal.JdbcResourceLocalTransactionCoordinatorImpl$TransactionDriverControlImpl.begin(JdbcResourceLocalTransactionCoordinatorImpl.java:246)
at org.hibernate.engine.transaction.internal.TransactionImpl.begin(TransactionImpl.java:83)
at org.hibernate.internal.AbstractSharedSessionContract.beginTransaction(AbstractSharedSessionContract.java:467)
at jdk.internal.reflect.GeneratedMethodAccessor166.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.hibernate.context.internal.ThreadLocalSessionContext$TransactionProtectionWrapper.invoke(ThreadLocalSessionContext.java:350)
at com.sun.proxy.$Proxy326.beginTransaction(Unknown Source)
at com.custom.gwtext.server.utils.HibernateUtilImpl.startTransaction(HibernateUtilImpl.java:335)
at com.custom.gwtext.server.utils.HibernateUtilImpl.startTransactionIfNeeded(HibernateUtilImpl.java:330)
at com.custom.gwtext.server.utils.HibernateUtilImpl.getSession(HibernateUtilImpl.java:70)
at com.custom.gwtext.server.utils.DbUtilImpl.doWork(DbUtilImpl.java:516)
at com.custom.gwtext.server.utils.DbUtilOracleImpl.executeQueryDBSpecific(DbUtilOracleImpl.java:117)
at com.custom.gwtext.server.utils.DbUtilOracleImpl.executeQueryDBSpecific(DbUtilOracleImpl.java:67)
at com.custom.gwtext.server.utils.DbUtilImpl.executeQueryInternal(DbUtilImpl.java:266)
at com.custom.gwtext.server.utils.DbUtilImpl.executeQuery(DbUtilImpl.java:173)
at com.custom.gwtext.server.query.QueriesDefinitionRegistryImpl.getData(QueriesDefinitionRegistryImpl.java:147)
at com.custom.gwtext.server.query.QueriesDefinitionRegistryImpl.getData(QueriesDefinitionRegistryImpl.java:74)
at com.custom.pins.server.data.helper.QueryHelper.executeSelectFirstRow(QueryHelper.java:54)
at com.custom.pins.server.data.helper.QueryHelper.selectFirstRow(QueryHelper.java:36)
at com.custom.pins.server.data.helper.QueryHelper.selectFirstValueRequired(QueryHelper.java:80)
at com.custom.pins.server.business.bdt.BusinessDataTableDataUtil.existsBusinessTable(BusinessDataTableDataUtil.java:20)
at com.custom.pins.server.business.bdt.BusinessDataTableBuilderImpl.existsTable(BusinessDataTableBuilderImpl.java:225)
at com.custom.pins.server.security.audit.ws.WebServiceLoggerConfigImpl.createWsRequestConfig(WebServiceLoggerConfigImpl.java:116)
at com.custom.pins.server.security.audit.ws.WebServiceLoggerConfigImpl.getWsRequestConfig(WebServiceLoggerConfigImpl.java:75)
at com.custom.pins.server.security.audit.ws.WebServiceAuditLogService.getWsRequestSpecificConfiguration(WebServiceAuditLogService.java:88)
at com.custom.pins.server.security.audit.ws.WebServiceAuditLogService.logIfConfigEnabled(WebServiceAuditLogService.java:71)
at com.custom.pins.server.security.audit.ws.WebServiceAuditLogService.lambda$getInternalWsLogConsumer$0(WebServiceAuditLogService.java:62)
at com.custom.gwtext.server.security.audit.AuditLogServiceImpl.lambda$createEventHandler$2(AuditLogServiceImpl.java:90)
at com.lmax.disruptor.BatchEventProcessor.run(BatchEventProcessor.java:150)
at java.base/java.lang.Thread.run(Thread.java:834)
after which they both stay active for a long time
[HikariPool-2 housekeeper] DEBUG com.zaxxer.hikari.pool.HikariPool - HikariPool-2 - After cleanup stats (total=17, active=2, idle=15, waiting=0)
Then after a few hours, this can be 3-10 hours, so no specific range, maybe depends on activity etc, no idea, this pops up in logs
[pool-10-thread-1] WARN c.zaxxer.hikari.pool.ProxyConnection - HikariPool-2 - Connection oracle.jdbc.driver.T4CConnection#5ae99303 marked as broken because of SQLSTATE(08006), ErrorCode(17002)
java.sql.SQLRecoverableException: IO Error: Connection reset by peer
at oracle.jdbc.driver.T4CCallableStatement.executeForRows(T4CCallableStatement.java:929)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1119)
at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3780)
at oracle.jdbc.driver.T4CCallableStatement.executeInternal(T4CCallableStatement.java:1300)
at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:3887)
at oracle.jdbc.driver.OracleCallableStatement.execute(OracleCallableStatement.java:4230)
at oracle.jdbc.driver.OraclePreparedStatementWrapper.execute(OraclePreparedStatementWrapper.java:1079)
at com.zaxxer.hikari.pool.ProxyPreparedStatement.execute(ProxyPreparedStatement.java:44)
at com.zaxxer.hikari.pool.HikariProxyCallableStatement.execute(HikariProxyCallableStatement.java)
at com.custom.pins.server.idgeneration.DatabaseSequenceIdPoolDataUtil.lambda$reserveIdBatch$0(DatabaseSequenceIdPoolDataUtil.java:34)
at org.hibernate.jdbc.WorkExecutor.executeWork(WorkExecutor.java:37)
at org.hibernate.internal.SessionImpl$1.accept(SessionImpl.java:2306)
at org.hibernate.internal.SessionImpl$1.accept(SessionImpl.java:2303)
at org.hibernate.engine.jdbc.internal.JdbcCoordinatorImpl.coordinateWork(JdbcCoordinatorImpl.java:306)
at org.hibernate.internal.SessionImpl.doWork(SessionImpl.java:2325)
at org.hibernate.internal.SessionImpl.doWork(SessionImpl.java:2310)
at jdk.internal.reflect.GeneratedMethodAccessor128.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.hibernate.context.internal.ThreadLocalSessionContext$TransactionProtectionWrapper.invoke(ThreadLocalSessionContext.java:350)
at com.sun.proxy.$Proxy326.doWork(Unknown Source)
at com.custom.pins.server.idgeneration.DatabaseSequenceIdPoolDataUtil.reserveIdBatch(DatabaseSequenceIdPoolDataUtil.java:29)
at com.custom.pins.server.idgeneration.DatabaseSequenceIdPool.reserveIdsInDatabase(DatabaseSequenceIdPool.java:106)
at com.custom.pins.server.idgeneration.DatabaseSequenceIdPool.access$300(DatabaseSequenceIdPool.java:24)
at com.custom.pins.server.idgeneration.DatabaseSequenceIdPool$ReserveIdsTask.run(DatabaseSequenceIdPool.java:125)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.io.IOException: Connection reset by peer
at java.base/sun.nio.ch.FileDispatcherImpl.read0(Native Method)
at java.base/sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:39)
at java.base/sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:276)
at java.base/sun.nio.ch.IOUtil.read(IOUtil.java:245)
at java.base/sun.nio.ch.IOUtil.read(IOUtil.java:223)
at java.base/sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:355)
at oracle.net.nt.TimeoutSocketChannel.read(TimeoutSocketChannel.java:144)
at oracle.net.ns.NIOHeader.readHeaderBuffer(NIOHeader.java:82)
at oracle.net.ns.NIOPacket.readFromSocketChannel(NIOPacket.java:139)
at oracle.net.ns.NIOPacket.readFromSocketChannel(NIOPacket.java:101)
at oracle.net.ns.NIONSDataChannel.readDataFromSocketChannel(NIONSDataChannel.java:80)
at oracle.jdbc.driver.T4CMAREngineNIO.prepareForReading(T4CMAREngineNIO.java:98)
at oracle.jdbc.driver.T4CMAREngineNIO.unmarshalUB1(T4CMAREngineNIO.java:534)
at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:485)
at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:252)
at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:612)
at oracle.jdbc.driver.T4CCallableStatement.doOall8(T4CCallableStatement.java:223)
at oracle.jdbc.driver.T4CCallableStatement.doOall8(T4CCallableStatement.java:56)
at oracle.jdbc.driver.T4CCallableStatement.executeForRows(T4CCallableStatement.java:907)
... 29 common frames omitted
[pool-10-thread-1] INFO com.zaxxer.hikari.pool.ProxyLeakTask - Previously reported leaked connection oracle.jdbc.driver.T4CConnection#5ae99303 on thread pool-10-thread-1 was returned to the pool (unleaked)
[HikariPool-2 connection closer] DEBUG com.zaxxer.hikari.pool.PoolBase - HikariPool-2 - Closing connection oracle.jdbc.driver.T4CConnection#5ae99303: (connection is broken)
Also, it's not active anymore (the active one is the second leaked one T4CConnection#7b911a8f on thread pool-6-thread-1 which somehow does not reset).
And right after this happens, our Java app starts to throw a lot of (even like 10 per second, sometimes less) below errors and becomes very slow
[pool-10-thread-1] WARN o.h.e.jdbc.spi.SqlExceptionHelper - SQL Error: 0, SQLState: null
[pool-10-thread-1] ERROR o.h.e.jdbc.spi.SqlExceptionHelper - Connection is closed
[pool-10-thread-1] ERROR l.p.p.s.i.DatabaseSequenceIdPool - error executing work
org.hibernate.exception.GenericJDBCException: error executing work
at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:47)
at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:113)
at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:99)
at org.hibernate.engine.jdbc.internal.JdbcCoordinatorImpl.coordinateWork(JdbcCoordinatorImpl.java:311)
at org.hibernate.internal.SessionImpl.doWork(SessionImpl.java:2325)
at org.hibernate.internal.SessionImpl.doWork(SessionImpl.java:2310)
at jdk.internal.reflect.GeneratedMethodAccessor128.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.hibernate.context.internal.ThreadLocalSessionContext$TransactionProtectionWrapper.invoke(ThreadLocalSessionContext.java:350)
at com.sun.proxy.$Proxy326.doWork(Unknown Source)
at com.custom.pins.server.idgeneration.DatabaseSequenceIdPoolDataUtil.reserveIdBatch(DatabaseSequenceIdPoolDataUtil.java:29)
at com.custom.pins.server.idgeneration.DatabaseSequenceIdPool.reserveIdsInDatabase(DatabaseSequenceIdPool.java:106)
at com.custom.pins.server.idgeneration.DatabaseSequenceIdPool.access$300(DatabaseSequenceIdPool.java:24)
at com.custom.pins.server.idgeneration.DatabaseSequenceIdPool$ReserveIdsTask.run(DatabaseSequenceIdPool.java:125)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.sql.SQLException: Connection is closed
at com.zaxxer.hikari.pool.ProxyConnection$ClosedConnection.lambda$getClosedConnection$0(ProxyConnection.java:489)
at com.sun.proxy.$Proxy307.prepareCall(Unknown Source)
at com.zaxxer.hikari.pool.ProxyConnection.prepareCall(ProxyConnection.java:290)
at com.zaxxer.hikari.pool.HikariProxyConnection.prepareCall(HikariProxyConnection.java)
at com.custom.pins.server.idgeneration.DatabaseSequenceIdPoolDataUtil.lambda$reserveIdBatch$0(DatabaseSequenceIdPoolDataUtil.java:31)
at org.hibernate.jdbc.WorkExecutor.executeWork(WorkExecutor.java:37)
at org.hibernate.internal.SessionImpl$1.accept(SessionImpl.java:2306)
at org.hibernate.internal.SessionImpl$1.accept(SessionImpl.java:2303)
at org.hibernate.engine.jdbc.internal.JdbcCoordinatorImpl.coordinateWork(JdbcCoordinatorImpl.java:306)
... 16 common frames omitted
So, it seems like although T4CConnection#5ae99303 is marked as broken, it's never evicted and the app still tries to use it.
Can this be related to HikariCP? Looks like we are using quite outdated version of Hikari and Hibernate, but somehow those versions are baked in some custom com.custom package and not sure how we can "overwrite" those versions. We are using Gradle for building the WAR file.
Oh and also just to add, there are no such issues when running without Kubernetes. Maybe this is related to network/firewalls, but somehow I think HikariCP should work around those broken connections in case they happen.
I would really appreciate the help or even some pointers where/what to look for.

HikariCP NOT configuring Datasource or adding postgres connection after updating spring-boot 1.x.x => 2.x.x

I recently updated my spring-boot/spring-batch application from spring-boot-starter 1.5.9.RELEASE (uses spring-version 4.3.13.RELEASE) => 2.2.4.RELEASE (uses spring-version 5.2.3.RELEASE. The 1.5.9.RELEASE was using Hikari 2.6.3; I did try this version also in my migrated/updated 2.2.4.RELEASE version of my app. 2.2.4.RELEASE uses Hikari 3.4.2 Neither seem to work. I am using postgresql 42.2.9
This is how the Hikari logs to my console when it works (when running the 1.5.9.RELEASE spring-boot version of my app):
3c22fb53ed64 2021-04-09 05:10:58.223 WARN CorrelationId=
[main] com.zaxxer.hikari.HikariConfig - HikariPool-1 - maxLifetime is less than 30000ms, setting to default 1800000ms.
3c22fb53ed64 2021-04-09 05:10:58.223 DEBUG CorrelationId=
[main] com.zaxxer.hikari.HikariConfig - HikariPool-1 - configuration:
3c22fb53ed64 2021-04-09 05:10:58.224 DEBUG CorrelationId=
[main] com.zaxxer.hikari.HikariConfig - allowPoolSuspension.............false
3c22fb53ed64 2021-04-09 05:10:58.224 DEBUG CorrelationId=
[main] com.zaxxer.hikari.HikariConfig - autoCommit......................false
3c22fb53ed64 2021-04-09 05:10:58.224 DEBUG CorrelationId=
[main] com.zaxxer.hikari.HikariConfig - catalog.........................none
3c22fb53ed64 2021-04-09 05:10:58.224 DEBUG CorrelationId=
[main] com.zaxxer.hikari.HikariConfig - connectionInitSql...............none
3c22fb53ed64 2021-04-09 05:10:58.224 DEBUG CorrelationId=
[main] com.zaxxer.hikari.HikariConfig - connectionTestQuery.............none
3c22fb53ed64 2021-04-09 05:10:58.224 DEBUG CorrelationId=
[main] com.zaxxer.hikari.HikariConfig - connectionTimeout...............60000
3c22fb53ed64 2021-04-09 05:10:58.224 DEBUG CorrelationId=
[main] com.zaxxer.hikari.HikariConfig - dataSource......................none
3c22fb53ed64 2021-04-09 05:10:58.224 DEBUG CorrelationId=
[main] com.zaxxer.hikari.HikariConfig - dataSourceClassName.............none
3c22fb53ed64 2021-04-09 05:10:58.224 DEBUG CorrelationId=
[main] com.zaxxer.hikari.HikariConfig - dataSourceJNDI..................none
3c22fb53ed64 2021-04-09 05:10:58.225 DEBUG CorrelationId=
[main] com.zaxxer.hikari.HikariConfig - dataSourceProperties............{password=<masked>}
3c22fb53ed64 2021-04-09 05:10:58.225 DEBUG CorrelationId=
[main] com.zaxxer.hikari.HikariConfig - driverClassName.................none
3c22fb53ed64 2021-04-09 05:10:58.225 DEBUG CorrelationId=
[main] com.zaxxer.hikari.HikariConfig - healthCheckProperties...........{}
3c22fb53ed64 2021-04-09 05:10:58.225 DEBUG CorrelationId=
[main] com.zaxxer.hikari.HikariConfig - healthCheckRegistry.............none
3c22fb53ed64 2021-04-09 05:10:58.225 DEBUG CorrelationId=
[main] com.zaxxer.hikari.HikariConfig - idleTimeout.....................600000
3c22fb53ed64 2021-04-09 05:10:58.225 DEBUG CorrelationId=
[main] com.zaxxer.hikari.HikariConfig - initializationFailFast..........true
3c22fb53ed64 2021-04-09 05:10:58.225 DEBUG CorrelationId=
[main] com.zaxxer.hikari.HikariConfig - initializationFailTimeout.......1
3c22fb53ed64 2021-04-09 05:10:58.225 DEBUG CorrelationId=
[main] com.zaxxer.hikari.HikariConfig - isolateInternalQueries..........false
3c22fb53ed64 2021-04-09 05:10:58.225 DEBUG CorrelationId=
[main] com.zaxxer.hikari.HikariConfig - jdbc4ConnectionTest.............false
3c22fb53ed64 2021-04-09 05:10:58.225 DEBUG CorrelationId=
[main] com.zaxxer.hikari.HikariConfig - jdbcUrl........................."jdbc:postgresql://mydatabaseurl.mywebsite.com:5432/supercooldatabase"
3c22fb53ed64 2021-04-09 05:10:58.225 DEBUG CorrelationId=
[main] com.zaxxer.hikari.HikariConfig - leakDetectionThreshold..........0
3c22fb53ed64 2021-04-09 05:10:58.225 DEBUG CorrelationId=
[main] com.zaxxer.hikari.HikariConfig - maxLifetime.....................1800000
3c22fb53ed64 2021-04-09 05:10:58.225 DEBUG CorrelationId=
[main] com.zaxxer.hikari.HikariConfig - maximumPoolSize.................5
3c22fb53ed64 2021-04-09 05:10:58.225 DEBUG CorrelationId=
[main] com.zaxxer.hikari.HikariConfig - metricRegistry..................none
3c22fb53ed64 2021-04-09 05:10:58.225 DEBUG CorrelationId=
[main] com.zaxxer.hikari.HikariConfig - metricsTrackerFactory...........none
3c22fb53ed64 2021-04-09 05:10:58.225 DEBUG CorrelationId=
[main] com.zaxxer.hikari.HikariConfig - minimumIdle.....................5
3c22fb53ed64 2021-04-09 05:10:58.225 DEBUG CorrelationId=
[main] com.zaxxer.hikari.HikariConfig - password........................<masked>
3c22fb53ed64 2021-04-09 05:10:58.225 DEBUG CorrelationId=
[main] com.zaxxer.hikari.HikariConfig - poolName........................"HikariPool-1"
3c22fb53ed64 2021-04-09 05:10:58.225 DEBUG CorrelationId=
[main] com.zaxxer.hikari.HikariConfig - readOnly........................false
3c22fb53ed64 2021-04-09 05:10:58.225 DEBUG CorrelationId=
[main] com.zaxxer.hikari.HikariConfig - registerMbeans..................false
3c22fb53ed64 2021-04-09 05:10:58.225 DEBUG CorrelationId=
[main] com.zaxxer.hikari.HikariConfig - scheduledExecutor...............none
3c22fb53ed64 2021-04-09 05:10:58.225 DEBUG CorrelationId=
[main] com.zaxxer.hikari.HikariConfig - scheduledExecutorService........internal
3c22fb53ed64 2021-04-09 05:10:58.225 DEBUG CorrelationId=
[main] com.zaxxer.hikari.HikariConfig - threadFactory...................internal
3c22fb53ed64 2021-04-09 05:10:58.225 DEBUG CorrelationId=
[main] com.zaxxer.hikari.HikariConfig - transactionIsolation............default
3c22fb53ed64 2021-04-09 05:10:58.226 DEBUG CorrelationId=
[main] com.zaxxer.hikari.HikariConfig - username........................"mktgoffers_ddladmin"
3c22fb53ed64 2021-04-09 05:10:58.226 DEBUG CorrelationId=
[main] com.zaxxer.hikari.HikariConfig - validationTimeout...............5000
3c22fb53ed64 2021-04-09 05:10:58.226 INFO CorrelationId=
[main] com.zaxxer.hikari.HikariDataSource - HikariPool-1 - Starting...
3c22fb53ed64 2021-04-09 05:10:59.377 DEBUG CorrelationId=
[main] com.zaxxer.hikari.pool.HikariPool - HikariPool-1 - Added connection org.postgresql.jdbc.PgConnection#14ed7ddf
3c22fb53ed64 2021-04-09 05:10:59.379 INFO CorrelationId=
[main] com.zaxxer.hikari.HikariDataSource - HikariPool-1 - Start completed.
3c22fb53ed64 2021-04-15 01:04:40.021 INFO CorrelationId=
[main] org.hibernate.dialect.Dialect - HHH000400: Using dialect: org.hibernate.dialect.PostgreSQL82Dialect
You can see it configures Hikari with my connection information and shows the jdbc url and even adds the postgresql connection.
This is how it looks when it does NOT work, after I updated to spring-boot 2.2.4.RELEASE:
2021-04-15 01:14:11.681 INFO 75096 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting...
2021-04-15 01:14:12.748 INFO 75096 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Start completed.
2021-04-15 01:14:12.760 INFO 75096 --- [ main] org.hibernate.dialect.Dialect : HHH000400: Using dialect: org.hibernate.dialect.PostgreSQL82Dialect
As you can see, its different. Normally I wouldn't care about logs, but when any of my JpaRepository methods get called like .saveAll(), the application hangs/stops doing anything and never writes to database. I was perplexed after first, and thought it was my Transaction/Entity manager setup in Spring-batch, but as I said before, all my code/configuration actually works perfectly fine (writes to database) on 1.5.9.RELEASE spring boot. Now, I just discovered this database config in the log, and I'm 99% sure my database connection isn't even initializing properly.
Here is my application yaml (this is a snippet, but has all relevant info to database connection):
spring:
application:
name: My Super Cool App
profiles:
active: "myLocal,myLocalDev"
batch.job.enabled: false
datasource:
hikari:
maximumPoolSize: 5
connectionTimeout: 60000
max-lifetime: 20000
auto-commit: false
jpa:
database: POSTGRESQL
database-platform: org.hibernate.dialect.PostgreSQL82Dialect
show-sql: false
hibernate:
ddl-auto: none
properties:
hibernate:
jdbc.batch_size: 5000
order_inserts: true
flushMode: COMMIT
---
spring:
profiles: myLocal
datasource:
url: jdbc:postgresql://database-main-url.mywebsite.com:5432/cooldbname
username: mysuperkewluser
password: hahasupersecretpw
And my definition for my database configuration, DatabaseConfiguration.java:
#Configuration
#EnableTransactionManagement
public class DatabaseConfiguration {
#Autowired
private Environment envVar;
#Autowired
private KeyVault keyProvider;
#Bean(name = "dataSource")
#ConfigurationProperties(
prefix = "spring.datasource.hikari"
)
public DataSource dataSource(DataSourceProperties dataSourceProperties) {
log.debug("Configuring Datasource");
String dbPassword = keyProvider.getKeyProvider(dataSourceProperties.getPassword());
return DataSourceBuilder
.create(dataSourceProperties.getClassLoader())
.type(HikariDataSource.class)
.driverClassName(dataSourceProperties.getDriverClassName())
.url(dataSourceProperties.getUrl())
.username(dataSourceProperties.getUsername())
.password(dbPassword)
.build();
}
}
I am using this #Autowiring this dataSource in my Spring Batch JobRepository, which is defined in my BatchConfiguration.java class
#Configuration
#EnableBatchProcessing
public class BatchConfiguration {
// Autowiring of the JobBuilderFactory, StepBuilderFactory here
#Bean
public JobRepository jobRepository(PlatformTransactionManager transactionManager, #Qualifier("dataSource") DataSource dataSource) throws Exception {
JobRepositoryFactoryBean jobRepositoryFactoryBean = new JobRepositoryFactoryBean();
jobRepositoryFactoryBean.setDataSource(dataSource); // dataSource
jobRepositoryFactoryBean.setTransactionManager(transactionManager);
jobRepositoryFactoryBean.setDatabaseType("POSTGRES");
return jobRepositoryFactoryBean.getObject();
// more business logic code here
}

HikariCP Connection aquistion errors

I developed a simple spring boot application that has a jms listener on IBM MQ. It receives some messages, does some transformation, saves the result to DB and drops the result into a different queue on same queue manager. The app is containerized and deployed on Openshift.
The app starts up successfully and works fine too. But after a arbitary amount of time I see connection aquisition errors. During this time the app is idle and not handling any traffic.
Spring boot version : 2.2.9.RELEASE
odbc version : 12.1.0.2
Below are my log entries. Any help is greatly appreciated.
2020-11-30 15:18:48.949 INFO 1 --- [ main] org.hibernate.Version : HHH000412: Hibernate ORM core version 5.4.18.Final
2020-11-30 15:18:50.006 INFO 1 --- [ main] o.hibernate.annotations.common.Version : HCANN000001: Hibernate Commons Annotations {5.1.0.Final}
2020-11-30 15:18:52.118 DEBUG 1 --- [ main] com.zaxxer.hikari.HikariConfig : HikariPool-1 - configuration:
2020-11-30 15:18:52.120 DEBUG 1 --- [ main] com.zaxxer.hikari.HikariConfig : allowPoolSuspension.............false
2020-11-30 15:18:52.120 DEBUG 1 --- [ main] com.zaxxer.hikari.HikariConfig : autoCommit......................true
2020-11-30 15:18:52.120 DEBUG 1 --- [ main] com.zaxxer.hikari.HikariConfig : catalog.........................none
2020-11-30 15:18:52.120 DEBUG 1 --- [ main] com.zaxxer.hikari.HikariConfig : connectionInitSql...............none
2020-11-30 15:18:52.120 DEBUG 1 --- [ main] com.zaxxer.hikari.HikariConfig : connectionTestQuery.............none
2020-11-30 15:18:52.121 DEBUG 1 --- [ main] com.zaxxer.hikari.HikariConfig : connectionTimeout...............30000
2020-11-30 15:18:52.121 DEBUG 1 --- [ main] com.zaxxer.hikari.HikariConfig : dataSource......................none
2020-11-30 15:18:52.121 DEBUG 1 --- [ main] com.zaxxer.hikari.HikariConfig : dataSourceClassName.............none
2020-11-30 15:18:52.121 DEBUG 1 --- [ main] com.zaxxer.hikari.HikariConfig : dataSourceJNDI..................none
2020-11-30 15:18:52.121 DEBUG 1 --- [ main] com.zaxxer.hikari.HikariConfig : dataSourceProperties............{password=<masked>}
2020-11-30 15:18:52.121 DEBUG 1 --- [ main] com.zaxxer.hikari.HikariConfig : driverClassName................."oracle.jdbc.OracleDriver"
2020-11-30 15:18:52.121 DEBUG 1 --- [ main] com.zaxxer.hikari.HikariConfig : exceptionOverrideClassName......none
2020-11-30 15:18:52.122 DEBUG 1 --- [ main] com.zaxxer.hikari.HikariConfig : healthCheckProperties...........{}
2020-11-30 15:18:52.122 DEBUG 1 --- [ main] com.zaxxer.hikari.HikariConfig : healthCheckRegistry.............none
2020-11-30 15:18:52.122 DEBUG 1 --- [ main] com.zaxxer.hikari.HikariConfig : idleTimeout.....................30000
2020-11-30 15:18:52.122 DEBUG 1 --- [ main] com.zaxxer.hikari.HikariConfig : initializationFailTimeout.......1
2020-11-30 15:18:52.122 DEBUG 1 --- [ main] com.zaxxer.hikari.HikariConfig : isolateInternalQueries..........false
2020-11-30 15:18:52.122 DEBUG 1 --- [ main] com.zaxxer.hikari.HikariConfig : jdbcUrl.........................jdbc:oracle:thin:
2020-11-30 15:18:52.122 DEBUG 1 --- [ main] com.zaxxer.hikari.HikariConfig : leakDetectionThreshold..........0
2020-11-30 15:18:52.122 DEBUG 1 --- [ main] com.zaxxer.hikari.HikariConfig : maxLifetime.....................2000000
2020-11-30 15:18:52.122 DEBUG 1 --- [ main] com.zaxxer.hikari.HikariConfig : maximumPoolSize.................5
2020-11-30 15:18:52.122 DEBUG 1 --- [ main] com.zaxxer.hikari.HikariConfig : metricRegistry..................none
2020-11-30 15:18:52.122 DEBUG 1 --- [ main] com.zaxxer.hikari.HikariConfig : metricsTrackerFactory...........none
2020-11-30 15:18:52.122 DEBUG 1 --- [ main] com.zaxxer.hikari.HikariConfig : minimumIdle.....................2
2020-11-30 15:18:52.122 DEBUG 1 --- [ main] com.zaxxer.hikari.HikariConfig : password........................<masked>
2020-11-30 15:18:52.122 DEBUG 1 --- [ main] com.zaxxer.hikari.HikariConfig : poolName........................"HikariPool-1"
2020-11-30 15:18:52.122 DEBUG 1 --- [ main] com.zaxxer.hikari.HikariConfig : readOnly........................false
2020-11-30 15:18:52.122 DEBUG 1 --- [ main] com.zaxxer.hikari.HikariConfig : registerMbeans..................false
2020-11-30 15:18:52.123 DEBUG 1 --- [ main] com.zaxxer.hikari.HikariConfig : scheduledExecutor...............none
2020-11-30 15:18:52.123 DEBUG 1 --- [ main] com.zaxxer.hikari.HikariConfig : schema..........................none
2020-11-30 15:18:52.123 DEBUG 1 --- [ main] com.zaxxer.hikari.HikariConfig : threadFactory...................internal
2020-11-30 15:18:52.123 DEBUG 1 --- [ main] com.zaxxer.hikari.HikariConfig : transactionIsolation............default
2020-11-30 15:18:52.123 DEBUG 1 --- [ main] com.zaxxer.hikari.HikariConfig : username........................"dummy"
2020-11-30 15:18:52.123 DEBUG 1 --- [ main] com.zaxxer.hikari.HikariConfig : validationTimeout...............5000
2020-11-30 15:18:52.123 INFO 1 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting...
2020-11-30 15:19:23.417 INFO 1 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Start completed.
2020-11-30 19:42:51.988 WARN 1 --- [oundedElastic-4] o.s.b.a.jdbc.DataSourceHealthIndicator : DataSource health check failed
org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is java.sql.SQLException: HikariPool-1 - Interrupted during connection acquisition
at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:82) ~[spring-jdbc-5.2.8.RELEASE.jar!/:5.2.8.RELEASE]
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:324) ~[spring-jdbc-5.2.8.RELEASE.jar!/:5.2.8.RELEASE]
at org.springframework.boot.actuate.jdbc.DataSourceHealthIndicator.getProduct(DataSourceHealthIndicator.java:122) ~[spring-boot-actuator-2.2.9.RELEASE.jar!/:2.2.9.RELEASE]
at org.springframework.boot.actuate.jdbc.DataSourceHealthIndicator.doDataSourceHealthCheck(DataSourceHealthIndicator.java:107) ~[spring-boot-actuator-2.2.9.RELEASE.jar!/:2.2.9.RELEASE]
at org.springframework.boot.actuate.jdbc.DataSourceHealthIndicator.doHealthCheck(DataSourceHealthIndicator.java:102) ~[spring-boot-actuator-2.2.9.RELEASE.jar!/:2.2.9.RELEASE]
at org.springframework.boot.actuate.health.AbstractHealthIndicator.health(AbstractHealthIndicator.java:82) ~[spring-boot-actuator-2.2.9.RELEASE.jar!/:2.2.9.RELEASE]
at reactor.core.publisher.MonoCallable.call(MonoCallable.java:91) ~[reactor-core-3.3.8.RELEASE.jar!/:3.3.8.RELEASE]
at reactor.core.publisher.FluxSubscribeOnCallable$CallableSubscribeOnSubscription.run(FluxSubscribeOnCallable.java:225) ~[reactor-core-3.3.8.RELEASE.jar!/:3.3.8.RELEASE]
at reactor.core.scheduler.SchedulerTask.call(SchedulerTask.java:68) ~[reactor-core-3.3.8.RELEASE.jar!/:3.3.8.RELEASE]
at reactor.core.scheduler.SchedulerTask.call(SchedulerTask.java:28) ~[reactor-core-3.3.8.RELEASE.jar!/:3.3.8.RELEASE]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[na:1.8.0_262]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) ~[na:1.8.0_262]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) ~[na:1.8.0_262]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[na:1.8.0_262]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[na:1.8.0_262]
at java.lang.Thread.run(Thread.java:748) ~[na:1.8.0_262]
Caused by: java.sql.SQLException: HikariPool-1 - Interrupted during connection acquisition
at com.zaxxer.hikari.pool.HikariPool.getConnection(HikariPool.java:201) ~[HikariCP-3.4.5.jar!/:na]
at com.zaxxer.hikari.pool.HikariPool.getConnection(HikariPool.java:162) ~[HikariCP-3.4.5.jar!/:na]
at com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:128) ~[HikariCP-3.4.5.jar!/:na]
at org.springframework.jdbc.datasource.DataSourceUtils.fetchConnection(DataSourceUtils.java:158) ~[spring-jdbc-5.2.8.RELEASE.jar!/:5.2.8.RELEASE]
at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:116) ~[spring-jdbc-5.2.8.RELEASE.jar!/:5.2.8.RELEASE]
at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:79) ~[spring-jdbc-5.2.8.RELEASE.jar!/:5.2.8.RELEASE]
... 15 common frames omitted
Caused by: java.lang.InterruptedException: null
at java.util.concurrent.SynchronousQueue.poll(SynchronousQueue.java:944) ~[na:1.8.0_262]
at com.zaxxer.hikari.util.ConcurrentBag.borrow(ConcurrentBag.java:151) ~[HikariCP-3.4.5.jar!/:na]
at com.zaxxer.hikari.pool.HikariPool.getConnection(HikariPool.java:180) ~[HikariCP-3.4.5.jar!/:na]
... 20 common frames omitted
2020-11-30 19:42:59.266 WARN 1 --- [oundedElastic-1] o.s.b.a.jdbc.DataSourceHealthIndicator : DataSource health check failed

Unable to obtain isolated JDBC connection: org.hibernate.exception.JDBCConnectionException

I am facing this problem for 2 hours.
The problem is I have other classes that are working well. I don't know why this error is happening for the current class.
org.hibernate.exception.JDBCConnectionException: unable to obtain isolated JDBC connection
Caused by: java.sql.SQLTransientConnectionException: HikariPool-1 - Connection is not available, request timed out after 351ms.
But the code works for other tables(other classes).
It was working so fine until today. Is there anyone that faced this problem before?
2020-03-13 13:52:25,392 [main] WARN com.zaxxer.hikari.HikariConfig -ScraperPool - idleTimeout is less than 10000ms, setting to default 600000ms.
2020-03-13 13:52:25,400 [main] DEBUG com.zaxxer.hikari.HikariConfig -ScraperPool - configuration:
2020-03-13 13:52:25,406 [main] DEBUG com.zaxxer.hikari.HikariConfig -allowPoolSuspension.............false
2020-03-13 13:52:25,407 [main] DEBUG com.zaxxer.hikari.HikariConfig -autoCommit......................true
2020-03-13 13:52:25,407 [main] DEBUG com.zaxxer.hikari.HikariConfig -catalog.........................none
2020-03-13 13:52:25,408 [main] DEBUG com.zaxxer.hikari.HikariConfig -connectionInitSql...............none
2020-03-13 13:52:25,408 [main] DEBUG com.zaxxer.hikari.HikariConfig -connectionTestQuery.............none
2020-03-13 13:52:25,409 [main] DEBUG com.zaxxer.hikari.HikariConfig -connectionTimeout...............10000
2020-03-13 13:52:25,409 [main] DEBUG com.zaxxer.hikari.HikariConfig -dataSource......................none
2020-03-13 13:52:25,409 [main] DEBUG com.zaxxer.hikari.HikariConfig -dataSourceClassName.............none
2020-03-13 13:52:25,410 [main] DEBUG com.zaxxer.hikari.HikariConfig -dataSourceJNDI..................none
2020-03-13 13:52:25,411 [main] DEBUG com.zaxxer.hikari.HikariConfig -dataSourceProperties............{password=<masked>, prepStmtCacheSqlLimit=2048, cachePrepStmts=true, prepStmtCacheSize=250, leakDetectionThreshold=15000}
2020-03-13 13:52:25,412 [main] DEBUG com.zaxxer.hikari.HikariConfig -driverClassName.................none
2020-03-13 13:52:25,412 [main] DEBUG com.zaxxer.hikari.HikariConfig -healthCheckProperties...........{}
2020-03-13 13:52:25,412 [main] DEBUG com.zaxxer.hikari.HikariConfig -healthCheckRegistry.............none
2020-03-13 13:52:25,413 [main] DEBUG com.zaxxer.hikari.HikariConfig -idleTimeout.....................600000
2020-03-13 13:52:25,413 [main] DEBUG com.zaxxer.hikari.HikariConfig -initializationFailTimeout.......1
2020-03-13 13:52:25,413 [main] DEBUG com.zaxxer.hikari.HikariConfig -isolateInternalQueries..........false
2020-03-13 13:52:25,414 [main] DEBUG com.zaxxer.hikari.HikariConfig -jdbcUrl.........................jdbc:mysql://**********?verifyServerCertificate=false&useSSL=true&serverTimezone=UTC
2020-03-13 13:52:25,414 [main] DEBUG com.zaxxer.hikari.HikariConfig -leakDetectionThreshold..........10000
2020-03-13 13:52:25,414 [main] DEBUG com.zaxxer.hikari.HikariConfig -maxLifetime.....................1800000
2020-03-13 13:52:25,414 [main] DEBUG com.zaxxer.hikari.HikariConfig -maximumPoolSize.................100
2020-03-13 13:52:25,415 [main] DEBUG com.zaxxer.hikari.HikariConfig -metricRegistry..................none
2020-03-13 13:52:25,415 [main] DEBUG com.zaxxer.hikari.HikariConfig -metricsTrackerFactory...........none
2020-03-13 13:52:25,415 [main] DEBUG com.zaxxer.hikari.HikariConfig -minimumIdle.....................4
2020-03-13 13:52:25,415 [main] DEBUG com.zaxxer.hikari.HikariConfig -password........................<masked>
2020-03-13 13:52:25,416 [main] DEBUG com.zaxxer.hikari.HikariConfig -poolName........................"ScraperPool"
2020-03-13 13:52:25,416 [main] DEBUG com.zaxxer.hikari.HikariConfig -readOnly........................false
2020-03-13 13:52:25,416 [main] DEBUG com.zaxxer.hikari.HikariConfig -registerMbeans..................true
2020-03-13 13:52:25,417 [main] DEBUG com.zaxxer.hikari.HikariConfig -scheduledExecutor...............none
2020-03-13 13:52:25,417 [main] DEBUG com.zaxxer.hikari.HikariConfig -schema..........................none
2020-03-13 13:52:25,417 [main] DEBUG com.zaxxer.hikari.HikariConfig -threadFactory...................internal
2020-03-13 13:52:25,417 [main] DEBUG com.zaxxer.hikari.HikariConfig -transactionIsolation............default
2020-03-13 13:52:25,418 [main] DEBUG com.zaxxer.hikari.HikariConfig -username........................"xxxxxxxxxxx"
2020-03-13 13:52:25,418 [main] DEBUG com.zaxxer.hikari.HikariConfig -validationTimeout...............5000
2020-03-13 13:52:25,420 [main] INFO com.zaxxer.hikari.HikariDataSource -ScraperPool - Starting...
2020-03-13 13:52:25,452 [main] DEBUG com.zaxxer.hikari.util.DriverDataSource -Loaded driver with class name com.mysql.cj.jdbc.Driver for jdbcUrl=jdbc:mysql://*********?verifyServerCertificate=false&useSSL=true&serverTimezone=UTC
2020-03-13 13:52:27,099 [main] DEBUG com.zaxxer.hikari.pool.HikariPool -ScraperPool - Added connection com.mysql.cj.jdbc.ConnectionImpl#e84a8e1
2020-03-13 13:52:27,107 [main] INFO com.zaxxer.hikari.HikariDataSource -ScraperPool - Start completed.
2020-03-13 13:52:27,211 [ScraperPool housekeeper] DEBUG com.zaxxer.hikari.pool.HikariPool -ScraperPool - Before cleanup stats (total=1, active=0, idle=1, waiting=0)
2020-03-13 13:52:27,212 [ScraperPool housekeeper] DEBUG com.zaxxer.hikari.pool.HikariPool -ScraperPool - After cleanup stats (total=1, active=0, idle=1, waiting=0)
2020-03-13 13:52:27,280 [ScraperPool connection adder] DEBUG com.zaxxer.hikari.pool.HikariPool -ScraperPool - Added connection com.mysql.cj.jdbc.ConnectionImpl#58b0aed5
2020-03-13 13:52:27,346 [ScraperPool connection adder] DEBUG com.zaxxer.hikari.pool.HikariPool -ScraperPool - Added connection com.mysql.cj.jdbc.ConnectionImpl#285edfdd
2020-03-13 13:52:27,414 [ScraperPool connection adder] DEBUG com.zaxxer.hikari.pool.HikariPool -ScraperPool - Added connection com.mysql.cj.jdbc.ConnectionImpl#79a25ba1
2020-03-13 13:52:27,415 [ScraperPool connection adder] DEBUG com.zaxxer.hikari.pool.HikariPool -ScraperPool - After adding stats (total=4, active=0, idle=4, waiting=0)
I got this line before the error occured
DEBUG com.zaxxer.hikari.pool.HikariPool -HikariPool-1 - Timeout failure stats (total=1, active=1, idle=0, waiting=0)
Try increasing the max limit of your pool. Below code tells you that pool reached max connection limit set in the config.
DEBUG com.zaxxer.hikari.pool.HikariPool -HikariPool-1 - Timeout failure stats (total=1, active=1, idle=0, waiting=0)

Jetty + Guice + Jersey gives 404 on accessing the resource

I have seen similar issues and solutions to those, but still cannot figure out the solution to mine.
I start Jetty server programmatically and hook Jersey using Guice into it. When I try to access my Jersey resource, I get 404.
public class TestService {
public static void main(String[] args) throws Exception {
Server server = new Server(8080);
ServletContextHandler context = new ServletContextHandler();
context.setContextPath("/");
server.setHandler(context);
final Injector injector = Guice.createInjector(new MyServletModule());
FilterHolder guiceFilter = new FilterHolder(injector.getInstance(GuiceFilter.class));
context.addFilter(guiceFilter, "/*", EnumSet.allOf(DispatcherType.class));
context.addEventListener(new GuiceServletContextListener() {
#Override
protected Injector getInjector() {
return injector;
}
});
server.start();
server.join();
}
}
class MyServletModule extends ServletModule {
#Override
protected void configureServlets() {
bind(GuiceContainer.class);
Map<String, String> parameters = Maps.newHashMap();
parameters.put(PackagesResourceConfig.PROPERTY_PACKAGES, "com.test");
parameters.put(JSONConfiguration.FEATURE_POJO_MAPPING, "true");
serve("/*").with(GuiceContainer.class, parameters);
}
}
My resource:
#Singleton
#Path("/")
public class MyResource {
#GET
public String sayhello() {
return "hello";
}
}
I can see that the resource is being loaded in the log:
INFO: Root resource classes found:
class com.test.MyResource
But I get 404 on loading http://localhost:8080/. I have also tried mapping the resource to other urls, fx /web, but it was still 404.
And complete log:
2013-07-23 11:06:07,993 [main] DEBUG org.eclipse.jetty.util.log - Logging to org.slf4j.impl.Log4jLoggerAdapter(org.eclipse.jetty.util.log) via org.eclipse.jetty.util.log.Slf4jLog
2013-07-23 11:06:08,114 [main] DEBUG org.eclipse.jetty.util.component.Container - Container org.eclipse.jetty.server.Server#18fef3d + SelectChannelConnector#0.0.0.0:8080 as connector
2013-07-23 11:06:08,131 [main] DEBUG org.eclipse.jetty.util.component.Container - Container org.eclipse.jetty.server.Server#18fef3d + o.e.j.s.ServletContextHandler{/,null} as handler
2013-07-23 11:06:08,425 [main] DEBUG org.eclipse.jetty.servlet.ServletHandler - filterNameMap={com.google.inject.servlet.GuiceFilter-1346515=com.google.inject.servlet.GuiceFilter-1346515}
2013-07-23 11:06:08,426 [main] DEBUG org.eclipse.jetty.servlet.ServletHandler - pathFilters=[[/*]/[]==31=>com.google.inject.servlet.GuiceFilter-1346515]
2013-07-23 11:06:08,426 [main] DEBUG org.eclipse.jetty.servlet.ServletHandler - servletFilterMap={}
2013-07-23 11:06:08,426 [main] DEBUG org.eclipse.jetty.servlet.ServletHandler - servletPathMap=null
2013-07-23 11:06:08,427 [main] DEBUG org.eclipse.jetty.servlet.ServletHandler - servletNameMap={}
2013-07-23 11:06:08,429 [main] DEBUG org.eclipse.jetty.util.component.AbstractLifeCycle - starting org.eclipse.jetty.server.Server#18fef3d
2013-07-23 11:06:08,429 [main] INFO org.eclipse.jetty.server.Server - jetty-8.1.0.RC5
2013-07-23 11:06:08,443 [main] DEBUG org.eclipse.jetty.util.component.Container - Container org.eclipse.jetty.server.Server#18fef3d + qtp22355327{8<=0<=0/254,-1} as threadpool
2013-07-23 11:06:08,444 [main] DEBUG org.eclipse.jetty.util.component.AbstractLifeCycle - starting o.e.j.s.ServletContextHandler{/,null}
2013-07-23 11:06:08,453 [main] DEBUG org.eclipse.jetty.util.component.Container - Container org.eclipse.jetty.servlet.ServletHandler#128f6ee + com.google.inject.servlet.GuiceFilter-1346515 as filter
2013-07-23 11:06:08,453 [main] DEBUG org.eclipse.jetty.util.component.Container - Container org.eclipse.jetty.servlet.ServletHandler#128f6ee + [/*]/[]==31=>com.google.inject.servlet.GuiceFilter-1346515 as filterMapping
2013-07-23 11:06:08,454 [main] DEBUG org.eclipse.jetty.util.component.Container - Container o.e.j.s.ServletContextHandler{/,null} + org.eclipse.jetty.servlet.ServletHandler#128f6ee as handler
2013-07-23 11:06:08,454 [main] DEBUG org.eclipse.jetty.util.component.AbstractLifeCycle - starting org.eclipse.jetty.servlet.ServletHandler#128f6ee
2013-07-23 11:06:08,454 [main] DEBUG org.eclipse.jetty.servlet.ServletHandler - filterNameMap={com.google.inject.servlet.GuiceFilter-1346515=com.google.inject.servlet.GuiceFilter-1346515}
2013-07-23 11:06:08,454 [main] DEBUG org.eclipse.jetty.servlet.ServletHandler - pathFilters=[[/*]/[]==31=>com.google.inject.servlet.GuiceFilter-1346515]
2013-07-23 11:06:08,454 [main] DEBUG org.eclipse.jetty.servlet.ServletHandler - servletFilterMap={}
2013-07-23 11:06:08,454 [main] DEBUG org.eclipse.jetty.servlet.ServletHandler - servletPathMap=null
2013-07-23 11:06:08,454 [main] DEBUG org.eclipse.jetty.servlet.ServletHandler - servletNameMap={}
2013-07-23 11:06:08,454 [main] DEBUG org.eclipse.jetty.server.handler.AbstractHandler - starting org.eclipse.jetty.servlet.ServletHandler#128f6ee
2013-07-23 11:06:08,454 [main] DEBUG org.eclipse.jetty.util.component.AbstractLifeCycle - STARTED org.eclipse.jetty.servlet.ServletHandler#128f6ee
2013-07-23 11:06:08,455 [main] DEBUG org.eclipse.jetty.server.handler.AbstractHandler - starting o.e.j.s.ServletContextHandler{/,null}
2013-07-23 11:06:08,455 [main] INFO org.eclipse.jetty.server.handler.ContextHandler - started o.e.j.s.ServletContextHandler{/,null}
2013-07-23 11:06:08,455 [main] DEBUG org.eclipse.jetty.util.component.AbstractLifeCycle - starting com.google.inject.servlet.GuiceFilter-1346515
2013-jul-23 11:06:08 com.sun.jersey.api.core.PackagesResourceConfig init
INFO: Scanning for root resource and provider classes in the packages:
com.test
2013-jul-23 11:06:08 com.sun.jersey.api.core.ScanningResourceConfig logClasses
INFO: Root resource classes found:
class com.test.MyResource
2013-jul-23 11:06:08 com.sun.jersey.api.core.ScanningResourceConfig init
INFO: No provider classes found.
2013-jul-23 11:06:08 com.sun.jersey.server.impl.application.WebApplicationImpl _initiate
INFO: Initiating Jersey application, version 'Jersey: 1.12 02/15/2012 04:51 PM'
2013-07-23 11:06:09,219 [main] DEBUG org.eclipse.jetty.util.component.AbstractLifeCycle - STARTED com.google.inject.servlet.GuiceFilter-1346515
2013-07-23 11:06:09,219 [main] DEBUG org.eclipse.jetty.util.component.AbstractLifeCycle - STARTED o.e.j.s.ServletContextHandler{/,null}
2013-07-23 11:06:09,219 [main] DEBUG org.eclipse.jetty.server.handler.AbstractHandler - starting org.eclipse.jetty.server.Server#18fef3d
2013-07-23 11:06:09,219 [main] DEBUG org.eclipse.jetty.util.component.AbstractLifeCycle - starting qtp22355327{8<=0<=0/254,-1}
2013-07-23 11:06:09,221 [main] DEBUG org.eclipse.jetty.util.component.AbstractLifeCycle - STARTED qtp22355327{8<=1<=8/254,0}
2013-07-23 11:06:09,222 [main] DEBUG org.eclipse.jetty.util.component.AbstractLifeCycle - starting SelectChannelConnector#0.0.0.0:8080
2013-07-23 11:06:09,258 [main] DEBUG org.eclipse.jetty.util.component.AbstractLifeCycle - starting null/null
2013-07-23 11:06:09,260 [main] DEBUG org.eclipse.jetty.util.component.AbstractLifeCycle - STARTED PooledBuffers [0/1024#6144,0/1024#16384,0/1024#-]/PooledBuffers [0/1024#6144,0/1024#32768,0/1024#-]
2013-07-23 11:06:09,260 [main] DEBUG org.eclipse.jetty.util.component.AbstractLifeCycle - starting org.eclipse.jetty.server.nio.SelectChannelConnector$ConnectorSelectorManager#20c906
2013-07-23 11:06:09,279 [main] DEBUG org.eclipse.jetty.util.component.AbstractLifeCycle - STARTED org.eclipse.jetty.server.nio.SelectChannelConnector$ConnectorSelectorManager#20c906
2013-07-23 11:06:09,279 [qtp22355327-10 Selector0] DEBUG org.eclipse.jetty.io.nio - Starting Thread[qtp22355327-10 Selector0,5,main] on org.eclipse.jetty.io.nio.SelectorManager$1#10c3a08
2013-07-23 11:06:09,280 [main] INFO org.eclipse.jetty.server.AbstractConnector - Started SelectChannelConnector#0.0.0.0:8080
2013-07-23 11:06:09,280 [main] DEBUG org.eclipse.jetty.util.component.AbstractLifeCycle - STARTED SelectChannelConnector#0.0.0.0:8080
2013-07-23 11:06:09,280 [main] DEBUG org.eclipse.jetty.util.component.AbstractLifeCycle - STARTED org.eclipse.jetty.server.Server#18fef3d
2013-07-23 11:06:16,602 [qtp22355327-10 Selector0] DEBUG org.eclipse.jetty.io.nio - created SCEP#cc7439{l(/127.0.0.1:61292)<->r(/127.0.0.1:8080),d=false,open=true,ishut=false,oshut=false,rb=false,wb=false,w=true,i=0}-{AsyncHttpConnection#e2892b,g=HttpGenerator{s=0,h=-1,b=-1,c=-1},p=HttpParser{s=-14,l=0,c=0},r=0}
2013-07-23 11:06:16,604 [qtp22355327-16] DEBUG org.eclipse.jetty.http.HttpParser - filled 0/0
2013-07-23 11:06:16,604 [qtp22355327-10 Selector0] DEBUG org.eclipse.jetty.io.nio - created SCEP#1dd9891{l(/127.0.0.1:61293)<->r(/127.0.0.1:8080),d=false,open=true,ishut=false,oshut=false,rb=false,wb=false,w=true,i=0}-{AsyncHttpConnection#14b6b02,g=HttpGenerator{s=0,h=-1,b=-1,c=-1},p=HttpParser{s=-14,l=0,c=0},r=0}
2013-07-23 11:06:16,604 [qtp22355327-14] DEBUG org.eclipse.jetty.http.HttpParser - filled 0/0
2013-07-23 11:06:16,634 [qtp22355327-17] DEBUG org.eclipse.jetty.http.HttpParser - filled 328/328
2013-07-23 11:06:16,641 [qtp22355327-17 - /] DEBUG org.eclipse.jetty.server.Server - REQUEST / on AsyncHttpConnection#e2892b,g=HttpGenerator{s=0,h=-1,b=-1,c=-1},p=HttpParser{s=-5,l=14,c=0},r=1
2013-07-23 11:06:16,641 [qtp22355327-17 - /] DEBUG org.eclipse.jetty.server.handler.ContextHandler - scope null||/ # o.e.j.s.ServletContextHandler{/,null}
2013-07-23 11:06:16,641 [qtp22355327-17 - /] DEBUG org.eclipse.jetty.server.handler.ContextHandler - context=||/ # o.e.j.s.ServletContextHandler{/,null}
2013-07-23 11:06:16,641 [qtp22355327-17 - /] DEBUG org.eclipse.jetty.servlet.ServletHandler - servlet ||/ -> null
2013-07-23 11:06:16,641 [qtp22355327-17 - /] DEBUG org.eclipse.jetty.servlet.ServletHandler - chain=null
2013-07-23 11:06:16,641 [qtp22355327-17 - /] DEBUG org.eclipse.jetty.servlet.ServletHandler - Not Found /
2013-07-23 11:06:16,647 [qtp22355327-17 - /] DEBUG org.eclipse.jetty.server.Server - RESPONSE / 404
2013-07-23 11:06:16,651 [qtp22355327-17] DEBUG org.eclipse.jetty.http.HttpParser - filled 0/0
2013-07-23 11:06:16,769 [qtp22355327-11] DEBUG org.eclipse.jetty.http.HttpParser - filled 279/279
2013-07-23 11:06:16,770 [qtp22355327-11 - /favicon.ico] DEBUG org.eclipse.jetty.server.Server - REQUEST /favicon.ico on AsyncHttpConnection#e2892b,g=HttpGenerator{s=0,h=-1,b=-1,c=-1},p=HttpParser{s=-5,l=14,c=0},r=2
2013-07-23 11:06:16,770 [qtp22355327-11 - /favicon.ico] DEBUG org.eclipse.jetty.server.handler.ContextHandler - scope null||/favicon.ico # o.e.j.s.ServletContextHandler{/,null}
2013-07-23 11:06:16,771 [qtp22355327-11 - /favicon.ico] DEBUG org.eclipse.jetty.server.handler.ContextHandler - context=||/favicon.ico # o.e.j.s.ServletContextHandler{/,null}
2013-07-23 11:06:16,771 [qtp22355327-11 - /favicon.ico] DEBUG org.eclipse.jetty.servlet.ServletHandler - servlet ||/favicon.ico -> null
2013-07-23 11:06:16,771 [qtp22355327-11 - /favicon.ico] DEBUG org.eclipse.jetty.servlet.ServletHandler - chain=null
2013-07-23 11:06:16,772 [qtp22355327-11 - /favicon.ico] DEBUG org.eclipse.jetty.servlet.ServletHandler - Not Found /favicon.ico
2013-07-23 11:06:16,774 [qtp22355327-11 - /favicon.ico] DEBUG org.eclipse.jetty.server.Server - RESPONSE /favicon.ico 404
2013-07-23 11:06:16,775 [qtp22355327-11] DEBUG org.eclipse.jetty.http.HttpParser - filled 0/0
2013-07-23 11:06:26,564 [qtp22355327-15] DEBUG org.eclipse.jetty.io.nio.ChannelEndPoint - ishut SCEP#1dd9891{l(/127.0.0.1:61293)<->r(/127.0.0.1:8080),d=true,open=true,ishut=false,oshut=false,rb=false,wb=false,w=true,i=1r}-{AsyncHttpConnection#14b6b02,g=HttpGenerator{s=0,h=-1,b=-1,c=-1},p=HttpParser{s=-14,l=0,c=0},r=0}
2013-07-23 11:06:26,564 [qtp22355327-15] DEBUG org.eclipse.jetty.http.HttpParser - filled -1/0
2013-07-23 11:06:26,566 [qtp22355327-15] DEBUG org.eclipse.jetty.io.nio.ChannelEndPoint - close SCEP#1dd9891{l(/127.0.0.1:61293)<->r(/127.0.0.1:8080),d=true,open=true,ishut=true,oshut=false,rb=false,wb=false,w=true,i=1r}-{AsyncHttpConnection#14b6b02,g=HttpGenerator{s=0,h=-1,b=-1,c=-1},p=HttpParser{s=0,l=0,c=0},r=0}
2013-07-23 11:06:26,568 [qtp22355327-10 Selector0] DEBUG org.eclipse.jetty.io.nio - destroyEndPoint SCEP#1dd9891{l(/127.0.0.1:61293)<->r(/127.0.0.1:8080),d=true,open=false,ishut=true,oshut=true,rb=false,wb=false,w=true,i=1!}-{AsyncHttpConnection#14b6b02,g=HttpGenerator{s=0,h=-1,b=-1,c=-1},p=HttpParser{s=0,l=0,c=0},r=0}
2013-07-23 11:06:26,572 [qtp22355327-10 Selector0] DEBUG org.eclipse.jetty.server.AbstractHttpConnection - closed AsyncHttpConnection#14b6b02,g=HttpGenerator{s=0,h=-1,b=-1,c=-1},p=HttpParser{s=0,l=0,c=0},r=0
You need a default servlet. Try adding
context.addServlet(DefaultServlet.class, "/");
after adding your Guice Filter.

Categories

Resources