Install spark-3.1.2-bin-without-hadoop.tgz
1.ClassNotFoundException: org.apache.log4j.spi.Filter
Launching a freshly downloaded spark reports the following error:
$ ./bin/spark-shell
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/log4j/spi/Filter
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
at java.lang.Class.privateGetMethodRecursive(Class.java:3048)
at java.lang.Class.getMethod0(Class.java:3018)
at java.lang.Class.getMethod(Class.java:1784)
at sun.launcher.LauncherHelper.validateMainClass(LauncherHelper.java:544)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:526)
Caused by: java.lang.ClassNotFoundException: org.apache.log4j.spi.Filter
at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 7 more
Solution:
Place log4j-1.2.17
.jar in the jars directory of the spark you just downloaded.
2.ClassNotFoundException: org.apache.hadoop.fs.FSDataInputStream
Missing hadoop-common-xxx.jar
dependency
3.ClassNotFoundException: org.slf4j.Logger
Missing slf4j-api-1.7.25.jar
dependency
4.ClassNotFoundException: org.slf4j.impl.StaticLoggerBinder
Missing log4j-slf4j-impl-2.12.1.jar
dependency
5.ClassNotFoundException: org.apache.logging.log4j.spi.AbstractLoggerAdapter
Missing log4j-api-2.12.1.jar
dependency
Read More:
- How to Solve Java Runtime (class file version 53.0)ERROR
- [Solved] Hive On Spark Error: Remote Spark Driver – HiveServer2 connection has been closed
- [Solved] SSM startup error: ClassNotFoundException: java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
- [Solved] Hadoop Error: HADOOP_HOME and hadoop.home.dir are unset.
- [Solved] Classnotfoundexception: org.springframework.core.nativedetector error
- How to Solve Swagger error: IllegalStateException
- [Solved] Hadoop Error: Exception in thread “main“ java.io.IOException: Error opening job jar: /usr/local/hadoop-2.
- How to Solve SQL comments error in the mybatis query
- How to Solve zipkin Install Error in Windows
- How to Solve JDBC connection error in spring MVC integration
- How to Solve Image Upload Error: Uncaught (in promise) DOMException: Failed to execute ‘put‘ on ‘IDBObjectStore‘
- MapReduce running in Hadoop environment with maven
- Java.lang.ClassNotFoundException: sun.jdbc.odbc.JdbcOdbcDriver [How to Solve]
- How to Solve Error executing DDL in JPA
- How to Solve Tomcat Error: Could not resolve view with name ‘xxx/xxxxxxx‘ in servlet with
- [Solved] Java.lang.ClassNotFoundException: org.apache.commons.fileupload.FileItemFactory
- How to Solve Log4j 2.5 upgrade to 2.15 error
- How to Solve Flynk Task Java verifyerror 209 error
- [Solved] hadoop Error: 9000 failed on connection exception java.net.ConnectException Denied to Access
- Linux: How to Solve jdk11+easy poi Export Excel Error