datastax / dsbulk

DataStax Bulk Loader (DSBulk) is an open-source, Apache-licensed, unified tool for loading into and unloading from Apache Cassandra(R), DataStax Astra and DataStax Enterprise (DSE)
Apache License 2.0
83 stars 30 forks source link

Exception in thread "main" java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory #461

Closed r3econ closed 1 year ago

r3econ commented 1 year ago

I am unable to run the dsbulk. I installed Java runtime but when I run dsbulk it fails with the following error:

Exception in thread "main" java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory
        at com.datastax.oss.dsbulk.runner.DataStaxBulkLoader.<clinit>(DataStaxBulkLoader.java:42)
Caused by: java.lang.ClassNotFoundException: org.slf4j.LoggerFactory
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        ... 1 more

Java version on the machine:

java version "1.8.0_351"
Java(TM) SE Runtime Environment (build 1.8.0_351-b10)
Java HotSpot(TM) 64-Bit Server VM (build 25.351-b10, mixed mode)

How can I solve this issue?

msmygit commented 1 year ago

@r3econ what is the full command that you ran (of course, with credentials redacted)? Also, could you run ./dsbulk --version and post the output here? Also specify what operating system are you attempting to do this.

r3econ commented 1 year ago

I ran dsbulk unload -k mykeyspace -t mytable -f configForUnloadingData > out.csv

However, running dsbulk -version gives the same result:

C:\Users\Administrator\Desktop\migration\dsbulk-1.10.0\dsbulk-1.10.0\bin>dsbulk -version
Exception in thread "main" java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory
        at com.datastax.oss.dsbulk.runner.DataStaxBulkLoader.<clinit>(DataStaxBulkLoader.java:42)
Caused by: java.lang.ClassNotFoundException: org.slf4j.LoggerFactory
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        ... 1 more
msmygit commented 1 year ago

It is supposed to be --version. Anyways, here is what I get on my machine:

% java -version
java version "1.8.0_271"
Java(TM) SE Runtime Environment (build 1.8.0_271-b09)
Java HotSpot(TM) 64-Bit Server VM (build 25.271-b09, mixed mode)

% ./dsbulk --version
DataStax Bulk Loader v1.10.0

Could you connect with me here to triage this? I suspect there is a problem with your Java Development Kit (JDK) installation.

M5stars commented 1 year ago

Hello, the same thing happened to me, did you resolved it? If yes, please, tell me how :) Thanks

msmygit commented 1 year ago

@M5stars same question to you,

https://github.com/datastax/dsbulk/issues/461#issuecomment-1373838780

M5stars commented 1 year ago

A friend of mine have tried in his computer with exactly the same procedure and all went okay, nothing wrong happened, so I dont understand why :(

CTPassion commented 8 months ago

Anyone still having and resolved this issue?

I am on Windows 11. I have tried different builds of OpenJDK 8, repaired, reinstalled...

>> java -version
openjdk version "1.8.0_402"
OpenJDK Runtime Environment (Temurin)(build 1.8.0_402-b06)
OpenJDK 64-Bit Server VM (Temurin)(build 25.402-b06, mixed mode)

>> dsbulk --version
Exception in thread "main" java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory
        at com.datastax.oss.dsbulk.runner.DataStaxBulkLoader.<clinit>(DataStaxBulkLoader.java:42)
Caused by: java.lang.ClassNotFoundException: org.slf4j.LoggerFactory
        at java.net.URLClassLoader.findClass(URLClassLoader.java:387)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
        ... 1 more
ashishmathewabraham commented 8 months ago

Check this pull request - https://github.com/datastax/dsbulk/issues/489 Solution - keep the path short where the install folder is

rgvenkatesh commented 8 months ago

Check this pull request - #489 Solution - keep the path short where the install folder is

Thanks Ashish. Worked for me.