I am trying to run a java jar from a Hadoop command as seen below
hadoop jar <jar>
but I am getting an exception as seen below
Exception in thread "main" java.lang.NoClassDefFoundError:org/apache/spark/deploy/SparkHadoopUtil
......
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.hadoop.util.RunJar.run(RunJar.java:226)
at org.apache.hadoop.util.RunJar.main(RunJar.java:141)
Caused by: java.lang.ClassNotFoundException: org.apache.spark.deploy.SparkHadoopUtil
at java.net.URLClassLoader.findClass(URLClassLoader.java:387)
at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
what do I need to add to the command to get through the error?
Related
Hello Please help me to solve the error command in termux when running a java program an error like this occurs when running a java program
Exception in thread "main" java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:58) Caused by: java.lang.NoClassDefFoundError: org/bitcoinj/core/ECKey at btc.btc2.btc.main(btc.java:28) ... 5 more
Caused by: java.lang.ClassNotFoundException: org.bitcoinj.core.ECKey at java.net.URLClassLoader.findClass(URLClassLoader.java:381) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 6 more
Please tell me what causes it, thank you.
org.bitcoinj.core.ECKey is not available at runtime
code:
hadoop jar /home/xnz/local/opt/apache-mahout-distribution-0.13.0/mahout-integration-0.13.0.jar \
org.apache.mahout.clustering.conversion.InputDriver \
-i /user/root/ -o /user/root/input/seqfile
error tip:
Exception in thread "main" java.lang.NoClassDefFoundError:
org/apache/commons/cli2/OptionException
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:278)
at org.apache.hadoop.util.RunJar.run(RunJar.java:214)
at org.apache.hadoop.util.RunJar.main(RunJar.java:136)
Caused by: java.lang.ClassNotFoundException:
org.apache.commons.cli2.OptionException
at java.net.URLClassLoader$1.run(URLClassLoader.java:359)
at java.net.URLClassLoader$1.run(URLClassLoader.java:348)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:347)
at java.lang.ClassLoader.loadClass(ClassLoader.java:430)
at java.lang.ClassLoader.loadClass(ClassLoader.java:363)
...4 more
``
It is clear from the exception. You are missing the org.apache.commons.cli2 Jar in your Classpath.
I want to check the test coverage, run through run Test in'lesson_3 with coverage. I get an error:
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:386)
at sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:401)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.intellij.rt.coverage.main.CoveragePremain.premain(CoveragePremain.java:66)
... 6 more
Caused by: java.lang.ArrayIndexOutOfBoundsException: 1
at com.intellij.rt.coverage.instrumentation.Instrumentator.premain(Instrumentator.java:64)
... 11 more
FATAL ERROR in native method: processing of -javaagent failed
Process finished with exit code 1
Exception in thread "main"
Based on your stack trace you are affected by IDEA-177038 which is marked as a duplicate of IDEABKL-5941.
The known workaround is to add following to the command line arguments:
-Djava.io.tmpdir=C:\Temp
JavaFX was working, but strangely, it throws Segmentation Fault (core dumped) now.
I don't know where the logs are kept, so I have launcher app/SceneBuilderApp.jar, just in case:
Exception in Application start method
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:389)
at com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:328)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:767)
Caused by: java.lang.RuntimeException: Exception in Application start method
at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:917)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$155(LauncherImpl.java:182)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.RuntimeException: Failed to load file:/opt/JavaFXSceneBuilder2.0/app/SceneBuilderApp.jar!/com/oracle/javafx/scenebuilder/app/DocumentWindow.fxml
at com.oracle.javafx.scenebuilder.kit.editor.panel.util.AbstractFxmlWindowController.makeRoot(AbstractFxmlWindowController.java:114)
at com.oracle.javafx.scenebuilder.kit.editor.panel.util.AbstractWindowController.getRoot(AbstractWindowController.java:91)
at com.oracle.javafx.scenebuilder.kit.editor.panel.util.AbstractWindowController.getScene(AbstractWindowController.java:111)
at com.oracle.javafx.scenebuilder.kit.editor.panel.util.AbstractWindowController.getStage(AbstractWindowController.java:134)
at com.oracle.javafx.scenebuilder.app.DocumentWindowController.openWindow(DocumentWindowController.java:1088)
at com.oracle.javafx.scenebuilder.app.SceneBuilderApp.handleLaunch(SceneBuilderApp.java:418)
at com.oracle.javafx.scenebuilder.app.AppPlatform.requestStartGeneric(AppPlatform.java:139)
at com.oracle.javafx.scenebuilder.app.AppPlatform.requestStart(AppPlatform.java:106)
at com.oracle.javafx.scenebuilder.app.SceneBuilderApp.start(SceneBuilderApp.java:371)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$162(LauncherImpl.java:863)
at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$175(PlatformImpl.java:326)
at com.sun.javafx.application.PlatformImpl.lambda$null$173(PlatformImpl.java:295)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$174(PlatformImpl.java:294)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
at com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
at com.sun.glass.ui.gtk.GtkApplication.lambda$null$49(GtkApplication.java:139)
... 1 more
Caused by: java.lang.RuntimeException: Failed to load file:/opt/JavaFXSceneBuilder2.0/app/SceneBuilderApp.jar!/com/oracle/javafx/scenebuilder/app/info/InfoPanel.fxml
at com.oracle.javafx.scenebuilder.kit.editor.panel.util.AbstractFxmlPanelController.makePanel(AbstractFxmlPanelController.java:93)
at com.oracle.javafx.scenebuilder.kit.editor.panel.util.AbstractPanelController.getPanelRoot(AbstractPanelController.java:130)
at com.oracle.javafx.scenebuilder.app.DocumentWindowController.controllerDidLoadFxml(DocumentWindowController.java:985)
at com.oracle.javafx.scenebuilder.kit.editor.panel.util.AbstractFxmlWindowController.makeRoot(AbstractFxmlWindowController.java:110)
... 17 more
Caused by: java.lang.RuntimeException: Failed to load file:/opt/JavaFXSceneBuilder2.0/app/SceneBuilderKit.jar!/com/oracle/javafx/scenebuilder/kit/editor/panel/inspector/editors/StringAutoSuggestEditor.fxml
at com.oracle.javafx.scenebuilder.kit.editor.panel.inspector.editors.EditorUtils.loadFxml(EditorUtils.java:483)
at com.oracle.javafx.scenebuilder.kit.editor.panel.inspector.editors.EditorUtils.loadFxml(EditorUtils.java:463)
at com.oracle.javafx.scenebuilder.kit.editor.panel.inspector.editors.AutoSuggestEditor.preInit(AutoSuggestEditor.java:124)
at com.oracle.javafx.scenebuilder.kit.editor.panel.inspector.editors.AutoSuggestEditor.<init>(AutoSuggestEditor.java:118)
at com.oracle.javafx.scenebuilder.kit.editor.panel.inspector.editors.AutoSuggestEditor.<init>(AutoSuggestEditor.java:103)
at com.oracle.javafx.scenebuilder.kit.editor.panel.inspector.editors.ControllerClassEditor.<init>(ControllerClassEditor.java:51)
at com.oracle.javafx.scenebuilder.app.info.InfoPanelController.performInitialization(InfoPanelController.java:186)
at com.oracle.javafx.scenebuilder.app.info.InfoPanelController.controllerDidLoadFxml(InfoPanelController.java:173)
at com.oracle.javafx.scenebuilder.kit.editor.panel.util.AbstractFxmlPanelController.makePanel(AbstractFxmlPanelController.java:89)
... 20 more
Caused by: javafx.fxml.LoadException:
file:/opt/JavaFXSceneBuilder2.0/app/SceneBuilderKit.jar!/com/oracle/javafx/scenebuilder/kit/editor/panel/inspector/editors/StringAutoSuggestEditor.fxml
at javafx.fxml.FXMLLoader.constructLoadException(FXMLLoader.java:2601)
at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2571)
at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2441)
at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2409)
at com.oracle.javafx.scenebuilder.kit.editor.panel.inspector.editors.EditorUtils.loadFxml(EditorUtils.java:481)
... 28 more
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:71)
at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:275)
at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2566)
... 31 more
Caused by: java.lang.NullPointerException
at com.oracle.javafx.scenebuilder.kit.editor.panel.inspector.editors.AutoSuggestEditor.initialize(AutoSuggestEditor.java:142)
... 41 more
Exception running application com.oracle.javafx.scenebuilder.app.SceneBuilderApp
Environment
Ubuntu 16.04
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
I had the same problem as you did.
As in the thread already mentioned this seems to be a kernel bug. Updating Ubuntu as usually + running dist-upgrade did the trick for me.
sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade
See here for information what dist-upgrade does.
I am running the jar on unix server and getting the following exception. It was working earlier
Exception in thread "main" java.lang.NoClassDefFoundError: org.apache.log4j.Logger
at bo.ExecuteScheduler.<clinit>(ExecuteScheduler.java:25)
at java.lang.J9VMInternals.initializeImpl(Native Method)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:200)
at java.lang.Class.forNameImpl(Native Method)
at java.lang.Class.forName(Class.java:172)
at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:56)
Caused by: java.lang.ClassNotFoundException: org.apache.log4j.Logger
at java.net.URLClassLoader.findClass(URLClassLoader.java:423)
at java.lang.ClassLoader.loadClass(ClassLoader.java:660)
at java.lang.ClassLoader.loadClass(ClassLoader.java:626)
... 6 more