У меня есть объединенный источник данных для соединения с базой данных Impala с помощью драйвера куста.Я использую конфигурацию, подобную этой:
spring:
datasource:
url: "jdbc:hive2://${impala.host}:${impala.port}/;auth=noSasl"
username: "${impala.username}"
password: "${impala.password}"
driverClassName: org.apache.hive.jdbc.HiveDriver
validation-query: select 1
test-on-borrow: true
test-while-idle: false
И я неоднократно получал эту ошибку:
07:23:32.507 [http-nio-8081-exec-3] WARN org.apache.thrift.transport.TIOStreamTransport - Error closing output stream.
java.net.SocketException: Socket closed
at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:118) ~[?:1.8.0_151]
at java.net.SocketOutputStream.write(SocketOutputStream.java:155) ~[?:1.8.0_151]
at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82) ~[?:1.8.0_151]
at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:140) ~[?:1.8.0_151]
at java.io.FilterOutputStream.close(FilterOutputStream.java:158) ~[?:1.8.0_151]
at org.apache.thrift.transport.TIOStreamTransport.close(TIOStreamTransport.java:110) [libthrift-0.9.2.jar!/:0.9.2]
at org.apache.thrift.transport.TSocket.close(TSocket.java:196) [libthrift-0.9.2.jar!/:0.9.2]
at org.apache.hive.jdbc.HiveConnection.close(HiveConnection.java:599) [hive-jdbc-1.1.0.jar!/:1.1.0]
at org.apache.tomcat.jdbc.pool.PooledConnection.disconnect(PooledConnection.java:374) [tomcat-jdbc-8.0.37.jar!/:?]
at org.apache.tomcat.jdbc.pool.PooledConnection.reconnect(PooledConnection.java:357) [tomcat-jdbc-8.0.37.jar!/:?]
at org.apache.tomcat.jdbc.pool.ConnectionPool.borrowConnection(ConnectionPool.java:794) [tomcat-jdbc-8.0.37.jar!/:?]
at org.apache.tomcat.jdbc.pool.ConnectionPool.borrowConnection(ConnectionPool.java:630) [tomcat-jdbc-8.0.37.jar!/:?]
at org.apache.tomcat.jdbc.pool.ConnectionPool.getConnection(ConnectionPool.java:187) [tomcat-jdbc-8.0.37.jar!/:?]
at org.apache.tomcat.jdbc.pool.DataSourceProxy.getConnection(DataSourceProxy.java:127) [tomcat-jdbc-8.0.37.jar!/:?]
at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:111) [spring-jdbc-4.2.8.RELEASE.jar!/:4.2.8.RELEASE]
at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:77) [spring-jdbc-4.2.8.RELEASE.jar!/:4.2.8.RELEASE]
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:615) [spring-jdbc-4.2.8.RELEASE.jar!/:4.2.8.RELEASE]
at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:680) [spring-jdbc-4.2.8.RELEASE.jar!/:4.2.8.RELEASE]
at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:707) [spring-jdbc-4.2.8.RELEASE.jar!/:4.2.8.RELEASE]
at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:757) [spring-jdbc-4.2.8.RELEASE.jar!/:4.2.8.RELEASE]
at org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate.query(NamedParameterJdbcTemplate.java:192) [spring-jdbc-4.2.8.RELEASE.jar!/:4.2.8.RELEASE]
Я не знаю, кто закрывает соединение.Знаете ли вы, как узнать, почему закрывается соединение?
Спасибо, Рафаэль.