我有一个汇总的数据源,可使用配置单元驱动程序与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]
我不知道谁在关闭连接。您知道如何找出连接被关闭的原因吗?
感谢拉斐尔。