Options

NoClassDefFoundError on Vertica Kafka package vkconfig [JAVA]

Hello everyone,

 

Im getting an error message when trying to run the following command:

 

sudo -u dbadmin /opt/vertica/packages/kafka/bin/vkconfig scheduler --add

 

The error i get is:

 

Exception in thread "main" java.lang.NoClassDefFoundError: com/vertica/jdbc/Driver
at com.vertica.solutions.kafka.util.SQLUtilities.getConnection(SQLUtilities.java:98)
at com.vertica.solutions.kafka.util.SQLUtilities.getConnection(SQLUtilities.java:132)
at com.vertica.solutions.kafka.cli.CLIUtil.assertDBConnectionWorks(CLIUtil.java:48)
at com.vertica.solutions.kafka.cli.SchedulerConfigurationCLI.run(SchedulerConfigurationCLI.java:267)
at com.vertica.solutions.kafka.cli.SchedulerConfigurationCLI.main(SchedulerConfigurationCLI.java:302)
Caused by: java.lang.ClassNotFoundException: com.vertica.jdbc.Driver
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 5 more
SERVER:/opt/vertica/packages/kafka/bin$ sudo -u dbadmin ./vkconfig scheduler --add
Exception in thread "main" java.lang.NoClassDefFoundError: com/vertica/jdbc/Driver
at com.vertica.solutions.kafka.util.SQLUtilities.getConnection(SQLUtilities.java:98)
at com.vertica.solutions.kafka.util.SQLUtilities.getConnection(SQLUtilities.java:132)
at com.vertica.solutions.kafka.cli.CLIUtil.assertDBConnectionWorks(CLIUtil.java:48)
at com.vertica.solutions.kafka.cli.SchedulerConfigurationCLI.run(SchedulerConfigurationCLI.java:267)
at com.vertica.solutions.kafka.cli.SchedulerConfigurationCLI.main(SchedulerConfigurationCLI.java:302)
Caused by: java.lang.ClassNotFoundException: com.vertica.jdbc.Driver
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)

 

I have tried adding the Vertica JDBC driver to the CLASSPATH (the one in /opt/vertica/java/lib), but this does not solve any issues. 

Does anybody have a clue what could be the reason for this error?

 

Im running Vertica Analytic Database v7.2.2-2 on Ubuntu 14.04 (AWS).

 

Kind regards,

Comments

  • Options
    SruthiASruthiA Vertica Employee Administrator

    What is the version of Kafka you are using? What is the version of your JDBC driver

  • Options

    I ran into the same problem.

    The vkconfig script seems to build its own CLASSPATH variable, so setting it up front does not help.

    The script seems to be misconfigured (at least in version 7.2.2) as it looks for /opt/vertica/java/lib/vertica-jdbc.jar when in reality there is a symlink named /opt/vertica/java/lib/vertica_jdbc.jar (note the underscore instead of a hyphen) that points to the current version to the driver.

    Renaming the symlink to vertica-jdbc.jar helped in my case.

  • Options
    bennetcolebennetcole Community Edition User

    java.lang.NoClassDefFoundError This exception indicates that the JVM looked in its internal class definition data structure for the definition of a class and did not find it. This is different than saying that it could not be loaded from the classpath. Usually this indicates that we previously attempted to load a class from the classpath, but it failed for some reason - now we're trying to use the class again (and thus need to load it, since it failed last time), but we're not even going to try to load it, because we failed loading it earlier (and reasonably suspect that we would fail again). The earlier failure could be a ClassNotFoundException or an ExceptionInInitializerError (indicating a failure in the static initialization block) or any number of other problems. The point is, a NoClassDefFoundError is not necessarily a classpath problem.

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Emoji
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file