First, can you tell more about how you get the driver in the first place?

If you got it from the distribution (following instructions at
http://drill.apache.org/docs/using-jdbc/#step-1:-getting-the-drill-jdbc-driver),
you should be good to go.

If you try to build it from source, make sure you're using the "shaded"
version of the driver which is located under exec/jdbc-all/target (should
be named drill-jdbc-all-<version>.jar).

If getting it as a maven dependency, that's the artifact you should use:
https://mvnrepository.com/artifact/org.apache.drill.exec/drill-jdbc-all/1.8.0

Cheers,

Laurent

On Wed, Oct 5, 2016 at 5:37 AM, noel o'kelly <[email protected]> wrote:

> ---------- Forwarded message ----------
> From: noel o'kelly <[email protected]>
> Date: Wed, Oct 5, 2016 at 1:34 PM
> Subject: Class not found exception
> To: [email protected]
>
>
>
>
>
> Hi,
>
> Complete newbie on Drill. Trying to get Java class to connect to embedded
> drill (version 1.8.0)
>
> and getting the follow exception when trying to make connection on local
> instance.
>
> Exception in thread "main" java.lang.NoClassDefFoundError:
> org/apache/drill/common/exceptions/UserException
> at org.apache.drill.jdbc.impl.DrillJdbc41Factory.newDrillConnec
> tion(DrillJdbc41Factory.java:64)
> at org.apache.drill.jdbc.impl.DrillFactory.newConnection(DrillF
> actory.java:69)
> at net.hydromatic.avatica.UnregisteredDriver.connect(Unregister
> edDriver.java:126)
> at org.apache.drill.jdbc.Driver.connect(Driver.java:72)
> at com.optimality.drill.JavaQuery.main(JavaQuery.java:22)
> Caused by: java.lang.ClassNotFoundException:
> org.apache.drill.common.except
> ions.UserException
> 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)
> ... 5 more
>  My problem is I can't find the jar that has the class. Any hints ??
>
> regards
> Noel O'Kelly
>

Reply via email to