Java NoSuchMethodError when connecting via JDBC to Hive

I get the following error when trying to connect to Hive from a simple java program in Eclipse. It looks like it connects and then throws this error. I can connect to the Hive Thrift server locally via beeline without any problems.

both libthrift.jar files are 0.9.2. The same thing on the client and server. The server and client versions are the same for the following .jar files:

hive-jdbc*.jar 1.2.0 hive-service*.jar 1.2.0 libfb303-0.9.0.jar 0.9.2 libthrift-0.9.0.jar 0.9.2 log4j-1.2.16.jar 1.2.16 slf4j-api-1.6.1.jar 1.7.5 slf4j-log4j12-1.6.1.jar 1.7.5 commons-logging-1.0.4.jar 1.1.3 Exception in thread "main" java.lang.NoSuchMethodError: org.apache.thrift.protocol.TProtocol.getScheme()Ljava/lang/Class; at org.apache.hive.service.cli.thrift.TCLIService$OpenSession_args.write(TCLIService.java:1854) at org.apache.thrift.TServiceClient.sendBase(TServiceClient.java:63) at org.apache.hive.service.cli.thrift.TCLIService$Client.send_OpenSession(TCLIService.java:150) at org.apache.hive.service.cli.thrift.TCLIService$Client.OpenSession(TCLIService.java:142) at org.apache.hive.jdbc.HiveConnection.openSession(HiveConnection.java:578) at org.apache.hive.jdbc.HiveConnection.<init>(HiveConnection.java:192) at org.apache.hive.jdbc.HiveDriver.connect(HiveDriver.java:105) at java.sql.DriverManager.getConnection(Unknown Source) at java.sql.DriverManager.getConnection(Unknown Source) 

The version of libthrift that I am using is indicated by Apache as having the getScheme () method.

Any help would be greatly appreciated!

0
source share
1 answer

Make sure you include the necessary jar files in your classpath. When you said that he was working on your local, I think you did it. If it does not work on the actual server, make sure that you deploy the necessary banks.

0
source

Source: https://habr.com/ru/post/1239551/


All Articles