Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Connection via com.cloudera.impala.jdbc.DataSource causes ClassCastException

Highlighted

Connection via com.cloudera.impala.jdbc.DataSource causes ClassCastException

Explorer

The latest Impala JDBC driver (2.6.15) seems to have an issue with its DataSource implementation. When trying to use com.cloudera.impala.jdbc.DataSource directly without any reference to the driver name, we get the following exception. Could anyone shed some light?

 

Exception in thread "main" java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
Caused by: java.sql.SQLException: Error creating Driver, Driver class name incorrect.
at com.cloudera.impala.jdbc.common.AbstractDataSource.doInitialize(Unknown Source)
at com.cloudera.impala.jdbc.common.AbstractDataSource.getSimbaConnection(Unknown Source)
at com.cloudera.impala.jdbc.common.AbstractDataSource.getConnection(Unknown Source)
... 5 more
Caused by: com.cloudera.impala.support.exceptions.GeneralException: Error creating Driver, Driver class name incorrect.
at com.cloudera.impala.dsi.core.impl.DSIDriverFactory.createDriver(Unknown Source)
... 9 more
Caused by: java.lang.ClassCastException: com.cloudera.impala.jdbc.Driver cannot be cast to com.cloudera.impala.dsi.core.interfaces.IDriver
... 10 more

 

 

1 REPLY 1

Re: Connection via com.cloudera.impala.jdbc.DataSource causes ClassCastException

New Contributor

I have a groovy script working fine with 

driver  : 'com.cloudera.impala.jdbc.DataSource',

but I was getting the same ClassCastException when running the same code within a Spring Boot application.

 

By changing the driver there to

driver  : 'com.cloudera.impala.jdbc.Driver',

instead of DataSource, I started getting successful connections and query results.

 

 

Don't have an account?
Coming from Hortonworks? Activate your account here