heavyai / heavyai-jdbc

A JDBC driver for connecting to an HeavyAI GPU database and running queries.

Home Page:https://www.heavy.ai/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DataGrip omnisci-jdbc driver NoClassDefFoundError: org/slf4j/LoggerFactory

armandleopold opened this issue · comments

On JetBrains DataGrip 2019.3
When i import the omnisci-jdbc driver and try to connect to it.
it state :

  at com.omnisci.jdbc.OmniSciDriver.<clinit>(OmniSciDriver.java:37)
  at java.base/java.lang.Class.forName0(Native Method)
  at java.base/java.lang.Class.forName(Class.java:315)
  at com.intellij.database.remote.RemoteJdbcServer.main(RemoteJdbcServer.java:14)
Caused by: java.lang.ClassNotFoundException: org.slf4j.LoggerFactory
  at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
  at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
  at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
  ... 4 more.
.

When we look at the .jar there is in fact no dependencies. How can i make it work ?

I had to add :

<plugin>
  <artifactId>maven-assembly-plugin</artifactId>
  <executions>
    <execution>
      <phase>package</phase>
      <goals>
        <goal>single</goal>
      </goals>
    </execution>
  </executions>
  <configuration>
    <descriptorRefs>
      <descriptorRef>jar-with-dependencies</descriptorRef>
    </descriptorRefs>
  </configuration>
</plugin>

Generating a jar with dependencies.
And now it works

Thanks for reporting. The JAR published to Maven is slim, which gives people the option of adding the dependencies they might need as part of a bigger project. Of course, this doesn't make the best experience when using an IDE.

For DataGrip, you could also add the JARs manually, or use the JDBC driver provided by the source OmniSci distribution (which is a fat jar with all the dependencies)