jdbc访问impala的时候加载驱动报错,怎样解决? 10C

java.sql.SQLException: [Simba]ImpalaJDBCDriver Error setting/closing session: {0}.
at com.cloudera.hivecommon.api.HS2Client.openSession(Unknown Source)
at com.cloudera.hivecommon.api.HS2Client.(Unknown Source)
at com.cloudera.hivecommon.api.HiveServer2ClientFactory.createClient(Unknown Source)
at com.cloudera.hivecommon.core.HiveJDBCCommonConnection.connect(Unknown Source)
at com.cloudera.jdbc.common.BaseConnectionFactory.doConnect(Unknown Source)
at com.cloudera.jdbc.common.AbstractDriver.connect(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
Caused by: com.cloudera.support.exceptions.GeneralException: [Simba]ImpalaJDBCDriver Error setting/closing session: {0}.
... 8 more
Caused by: org.apache.thrift.TApplicationException: Invalid method name: 'OpenSession'
at org.apache.thrift.TApplicationException.read(TApplicationException.java:108)
at org.apache.thrift.TServiceClient.receiveBase(TServiceClient.java:71)
at org.apache.hive.service.cli.thrift.TCLIService$Client.recv_OpenSession(TCLIService.java:159)
at com.cloudera.hivecommon.api.HS2ClientWrapper.recv_OpenSession(Unknown Source)
at org.apache.hive.service.cli.thrift.TCLIService$Client.OpenSession(TCLIService.java:146)
at com.cloudera.hivecommon.api.HS2ClientWrapper.OpenSession(Unknown Source)
at com.cloudera.hivecommon.api.HS2Client.openSession(Unknown Source)
at com.cloudera.hivecommon.api.HS2Client.(Unknown Source)
at com.cloudera.hivecommon.api.HiveServer2ClientFactory.createClient(Unknown Source)
at com.cloudera.hivecommon.core.HiveJDBCCommonConnection.connect(Unknown Source)
at com.cloudera.jdbc.common.BaseConnectionFactory.doConnect(Unknown Source)
at com.cloudera.jdbc.common.AbstractDriver.connect(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at com.impala.test.Test.main(Test.java:23)

3个回答

你的对像没有创建成功,返回的对象是空的,导致调用的时候无法连接

我在tomcat上也遇到这个问题, 官网的解释是端口21050端口被占了, 所以设置为另外一个tomcat上就没问题.

The default port used by JDBC 2.0 and later (as well as ODBC 2.x) is 21050. Impala server accepts JDBC connections through this same port 21050 by default. Make sure this port is available for communication with other hosts on your network, for example, that it is not blocked by firewall software. If your JDBC client software connects to a different port, specify that alternative port number with the --hs2_port option when starting impalad. See Starting Impala for details about Impala startup options. See Ports Used by Impala for information about all ports used for communication between Impala and clients or between Impala components.

http://www.cloudera.com/documentation/archive/impala/2-x/2-1-x/topics/impala_jdbc.html#jdbc_port_unique_1

楼主,解决了吗,我也遇到了同样的问题,能告诉下吗?谢谢了!

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问