Reply
Highlighted
New Contributor
Posts: 1
Registered: ‎09-20-2017

Impala JDBC driver with IKVM in .net environment

Hello,

I am having a problem establishing a connection with the Impala JDBC driver from a .net application.
In my Java class, I create a connection using the Impala driver, and on Java side it works fine.
However, when I convert to dll and use the class in .net, i get the following error:

com.cloudera.support.exceptions.GeneralException: DRIVER_DEFAULT_PROP_ERR
        at com.cloudera.hivecommon.core.HiveJDBCCommonDriver.setDefaultPropertie
s(Unknown Source)
        at com.cloudera.hivecommon.core.HiveJDBCCommonDriver.<init>(Unknown Sour
ce)
        at com.cloudera.impala.core.ImpalaJDBCDriver.<init>(Unknown Source)
        at cli.System.RuntimeTypeHandle.CreateInstance(Unknown Source)
        at cli.System.RuntimeType.CreateInstanceSlow(Unknown Source)
        at cli.System.Activator.CreateInstance(Unknown Source)
        at cli.System.Activator.CreateInstance(Unknown Source)
        at Java_sun_reflect_ReflectionFactory+ActivatorConstructorAccessor.newIn
stance(Unknown Source)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:414)
        at java.lang.Class.newInstance(Class.java:480)
        at com.cloudera.dsi.core.impl.DSIDriverFactory.createDriver(Unknown Sour
ce)
        at com.cloudera.jdbc.common.AbstractDriver.doInitialize(Unknown Source)
        at com.cloudera.jdbc.common.AbstractDriver.connect(Unknown Source)
        at JdbcConnection.CreateConnectionWithJDBC(JdbcConnection.java:41)
        at cli.netjdbc.Program.Main(Program.cs:40)
        at cli.System.AppDomain._nExecuteAssembly(Unknown Source)
        at cli.System.AppDomain.ExecuteAssembly(Unknown Source)
java.sql.SQLException: Error creating Driver, Driver class name incorrect.
        at com.cloudera.jdbc.common.AbstractDriver.doInitialize(Unknown Source)
        at com.cloudera.jdbc.common.AbstractDriver.connect(Unknown Source)
        at JdbcConnection.CreateConnectionWithJDBC(JdbcConnection.java:41)
        at cli.netjdbc.Program.Main(Program.cs:40)
        at cli.System.AppDomain._nExecuteAssembly(Unknown Source)
        at cli.System.AppDomain.ExecuteAssembly(Unknown Source)
        at cli.Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly(U
nknown Source)
Caused by: com.cloudera.support.exceptions.GeneralException: Error creating Driv
er, Driver class name incorrect.
        at com.cloudera.dsi.core.impl.DSIDriverFactory.createDriver(Unknown Sour
ce)
        ... 7 more



The code I used in java is this, yet I have also tried with the DriverManager, to load the classes on runtime and to also create a dll of the driver only.

public Connection CreateConnectionWithJDBC() throws SQLException{
       
        try{
            
               Driver driver = new com.cloudera.impala.jdbc4.Driver();
               Properties props = new Properties();
               props.setProperty("user", this.userName);
               props.setProperty("password", this.password);
               this.connection = driver.connect(this.urlString, props);
        }
        catch (Exception ex){
            ex.printStackTrace();
        }
        
        
        return this.connection;
    }
It doesnt work neither with JDK nor with OpenJDK.

When converting the jar to dll I also tried to use it as a reference, two dlls with the sharedclassloader, but still nothing.
Even when I tried to convert the jar files to a single dll, without intermidiate java code, I still get the same error.

I'd much appreciate any help.

Elli

Announcements