Skip to content
This repository has been archived by the owner on Oct 1, 2024. It is now read-only.

ClassNotFoundException: org.apache.commons.codec.binary.Base64 #3

Closed
ghazel opened this issue Oct 14, 2016 · 3 comments
Closed

ClassNotFoundException: org.apache.commons.codec.binary.Base64 #3

ghazel opened this issue Oct 14, 2016 · 3 comments

Comments

@ghazel
Copy link

ghazel commented Oct 14, 2016

Does not seem to include all dependencies:

java.lang.NoClassDefFoundError: org/apache/commons/codec/binary/Base64
    at org.apache.http.impl.auth.BasicScheme.authenticate(BasicScheme.java:168)
    at org.apache.hive.jdbc.HttpBasicAuthInterceptor.addHttpAuthHeader(HttpBasicAuthInterceptor.java:52)
    at org.apache.hive.jdbc.HttpRequestInterceptorBase.process(HttpRequestInterceptorBase.java:74)
    at org.apache.http.protocol.ImmutableHttpProcessor.process(ImmutableHttpProcessor.java:132)
    at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:182)
    at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:88)
    at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)
    at org.apache.http.impl.execchain.ServiceUnavailableRetryExec.execute(ServiceUnavailableRetryExec.java:84)
    at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:184)
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:117)
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:55)
    at org.apache.thrift.transport.THttpClient.flushUsingHttpClient(THttpClient.java:251)
    at org.apache.thrift.transport.THttpClient.flush(THttpClient.java:313)
    at org.apache.thrift.TServiceClient.sendBase(TServiceClient.java:73)
    at org.apache.thrift.TServiceClient.sendBase(TServiceClient.java:62)
    at org.apache.hive.service.cli.thrift.TCLIService$Client.send_OpenSession(TCLIService.java:154)
    at org.apache.hive.service.cli.thrift.TCLIService$Client.OpenSession(TCLIService.java:146)
    at org.apache.hive.jdbc.HiveConnection.openSession(HiveConnection.java:552)
    at org.apache.hive.jdbc.HiveConnection.<init>(HiveConnection.java:170)
    at org.apache.hive.jdbc.HiveDriver.connect(HiveDriver.java:105)
    at java.sql.DriverManager.getConnection(DriverManager.java:664)
    at java.sql.DriverManager.getConnection(DriverManager.java:208)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.codec.binary.Base64
    at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    ... 26 more
@ghazel ghazel changed the title NoClassDefFoundError: org/apache/commons/codec/binary/Base64 ClassNotFoundException: org.apache.commons.codec.binary.Base64 Oct 14, 2016
@ghazel
Copy link
Author

ghazel commented Oct 14, 2016

This fixed it for me:

diff --git a/pom.xml b/pom.xml
index d4d9909..d56e58a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -19,6 +19,7 @@
         <hive.version>1.2.1000.2.5.0.0-1245</hive.version>
         <hadoop.version>2.7.3.2.5.0.0-1245</hadoop.version>
         <slf4j.version>1.7.21</slf4j.version>
+        <commons-codec.version>1.10</commons-codec.version>
     </properties>

     <repositories>
@@ -35,6 +36,12 @@
     <dependencies>

         <dependency>
+            <groupId>commons-codec</groupId>
+            <artifactId>commons-codec</artifactId>
+            <version>${commons-codec.version}</version>
+        </dependency>
+
+        <dependency>
             <groupId>org.apache.hive</groupId>
             <artifactId>hive-jdbc</artifactId>
             <version>${hive.version}</version>
@@ -140,6 +147,7 @@
                                 <includes>
                                     <include>com.google.guava:guava</include>
                                     <include>commons-lang:commons-lang</include>
+                                    <include>commons-codec:commons-codec</include>
                                     <include>org.apache.hadoop:hadoop-common</include>
                                     <include>org.apache.hive:hive-common</include>
                                     <include>org.apache.hive:hive-jdbc</include>

@timveil
Copy link
Owner

timveil commented Oct 19, 2016

thanks greg! i'll update shortly

@timveil
Copy link
Owner

timveil commented Oct 19, 2016

resolved issue. see updated release https://github.com/timveil/hive-jdbc-uber-jar/releases/tag/v1.1-2.5.0

@timveil timveil closed this as completed Oct 19, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants