0
votes

I have used the JDBC api to connect to HIVE2 referring here, it was successful so for easy of access I thought of creating a webapp around it using JSP as front-end page to enter server name and query. While all parameters are resolved correctly from JSP page to servlet it throws an error while connecting to HIVE server its required to place libthrift and hive JARS in WEB-INF/lib directory I placed in both WEB-INF/lib and classpath.

Issue is as hive jar comes first in WEB-INF/lib and as it does not have "org.apache.thrift.protocol.TProtocol.getScheme()" method I keep getting no such method error. I referred here and here and moved the libthrift jar to WEB-INF/classes but it dint help:

Jar versions: libthrift-0.9.3 and hive-0.4.1

1
Are you serious about the Hive version?? V0.4.1 was released in 2009; Cloudera distibution ships with V1.2 (and they are notoriously cautious); and V2.0 is available. - Samson Scharfrichter
@SamsonScharfrichter: Hi, I meant Hive2 in context of link our hive server version is "hive-0.13" - Vinod
Hive2 usually refers to "HiveServer2", the 2nd-generation JDBC service. Nothing to do with Hive version proper. - Samson Scharfrichter
Ok... But it was working fine before... Just after trying to build web app it's failing - Vinod
I guess the ordering in WEB-INF/lib is the problem as hive-0.4.1 jar does not have "Tprotocol.getScheme()" method - Vinod

1 Answers

1
votes

If only your Hive version was more recent, you could...

But alas, you cannot user a driver that is more recent that your server -- here V0.13, i.e. the last version without a "standalone" driver JAR. So you've got a whole bunch of Hive JARs to collect, plus a couple of Hadoop JARs and various dependencies such as libfb303-*.jar and libthrift-*.jar

$ unzip -l libthrift-0.9.2.jar | grep org.apache.thrift.protocol.TProtocol.class

2958 11-05-2014 03:47 org/apache/thrift/protocol/TProtocol.class