drill-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Deneche A. Hakim (JIRA)" <j...@apache.org>
Subject [jira] [Created] (DRILL-3784) simple Jdbc program fails with NoClassDefFoundError
Date Tue, 15 Sep 2015 19:42:45 GMT
Deneche A. Hakim created DRILL-3784:
---------------------------------------

             Summary: simple Jdbc program fails with NoClassDefFoundError
                 Key: DRILL-3784
                 URL: https://issues.apache.org/jira/browse/DRILL-3784
             Project: Apache Drill
          Issue Type: Bug
    Affects Versions: 1.2.0
            Reporter: Deneche A. Hakim
            Assignee: Jacques Nadeau
            Priority: Blocker


I have zookeeper installed and I'm running a single drillbit.

I'm running a simple Jdbc program that uses drill-jdbc-all, and I do get the following error
when trying to connect:
{noformat}
Exception in thread "main" java.lang.NoClassDefFoundError: oadd/org/codehaus/jackson/map/ObjectMapper
	at oadd.org.apache.curator.x.discovery.details.JsonInstanceSerializer.<init>(JsonInstanceSerializer.java:42)
	at oadd.org.apache.curator.x.discovery.ServiceDiscoveryBuilder.builder(ServiceDiscoveryBuilder.java:42)
	at oadd.org.apache.drill.exec.coord.zk.ZKClusterCoordinator.getDiscovery(ZKClusterCoordinator.java:265)
	at oadd.org.apache.drill.exec.coord.zk.ZKClusterCoordinator.<init>(ZKClusterCoordinator.java:103)
	at oadd.org.apache.drill.exec.client.DrillClient.connect(DrillClient.java:185)
	at org.apache.drill.jdbc.impl.DrillConnectionImpl.<init>(DrillConnectionImpl.java:134)
	at org.apache.drill.jdbc.impl.DrillJdbc41Factory.newDrillConnection(DrillJdbc41Factory.java:66)
	at org.apache.drill.jdbc.impl.DrillFactory.newConnection(DrillFactory.java:69)
	at oadd.net.hydromatic.avatica.UnregisteredDriver.connect(UnregisteredDriver.java:126)
	at org.apache.drill.jdbc.Driver.connect(Driver.java:72)
	at java.sql.DriverManager.getConnection(DriverManager.java:571)
	at java.sql.DriverManager.getConnection(DriverManager.java:233)
	at SimpleJdbc.main(SimpleJdbc.java:13)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at com.intellij.rt.execution.application.AppMain.main(AppMain.java:140)
Caused by: java.lang.ClassNotFoundException: oadd.org.codehaus.jackson.map.ObjectMapper
	at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
	... 18 more
{noformat}

Using jdbc-all built right before DRILL-3589 commit works fine, so the problem seem to be
related to the changes in DRILL-3589

Here is the program I'm running:
{code}
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;

public class SimpleJdbc {

  public static void main(String[] args) throws Exception {
    Class.forName("org.apache.drill.jdbc.Driver").newInstance();
    Connection conn = DriverManager.getConnection("jdbc:drill:");

    Statement stmt = null;
    ResultSet rs = null;

    try {
      stmt = conn.createStatement();
      rs = stmt.executeQuery("SELECT employee_id FROM cp.`employee.json`");

      while (rs.next()) {
        System.out.println(rs.getObject(1));
      }

    } finally {
      if (stmt != null) {
        stmt.close();
      }
      if (rs != null) {
        rs.close();
      }

      conn.close();
    }
  }
}
{code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message