Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/389.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/wix/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 关于SLF4J的例外情况_Java_Eclipse_Slf4j - Fatal编程技术网

Java 关于SLF4J的例外情况

Java 关于SLF4J的例外情况,java,eclipse,slf4j,Java,Eclipse,Slf4j,我对Java应用程序相当陌生。我正试图在eclipse中运行这个开源应用程序。我已经一个接一个地包含了所需的所有外部库,并删除了所有错误。现在,当我运行应用程序时,我在运行时遇到异常。控制台中的消息如下所示: Exception in thread "JavaFX Application Thread" Exception in thread "main" java.lang.NoClassDefFoundError: ch/qos/logback/core/joran/spi/JoranExc

我对Java应用程序相当陌生。我正试图在eclipse中运行这个开源应用程序。我已经一个接一个地包含了所需的所有外部库,并删除了所有错误。现在,当我运行应用程序时,我在运行时遇到异常。控制台中的消息如下所示:

Exception in thread "JavaFX Application Thread" Exception in thread "main" java.lang.NoClassDefFoundError: ch/qos/logback/core/joran/spi/JoranException
    at org.slf4j.LoggerFactory.getSingleton(LoggerFactory.java:189)
    at org.slf4j.LoggerFactory.bind(LoggerFactory.java:112)
    at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:105)
    at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:235)
    at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:208)
    at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:221)
    at com.shootoff.Main.<clinit>(Main.java:59)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Unknown Source)
    at com.sun.javafx.application.LauncherImpl.lambda$launchApplicationWithArgs$2(LauncherImpl.java:352)
    at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$7(PlatformImpl.java:326)
    at com.sun.javafx.application.PlatformImpl.lambda$null$5(PlatformImpl.java:295)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sun.javafx.application.PlatformImpl.lambda$runLater$6(PlatformImpl.java:294)
    at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
    at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
    at com.sun.glass.ui.win.WinApplication.lambda$null$4(WinApplication.java:186)
    at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: ch.qos.logback.core.joran.spi.JoranException
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    ... 18 more
java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at sun.launcher.LauncherHelper$FXHelper.main(Unknown Source)
Caused by: java.lang.NullPointerException
    at com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:383)
    at com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:328)
    ... 5 more
线程“JavaFX应用程序线程”中的异常线程“main”java.lang.NoClassDefFoundError中的异常:ch/qos/logback/core/joran/spi/JoranException
位于org.slf4j.LoggerFactory.getSingleton(LoggerFactory.java:189)
位于org.slf4j.LoggerFactory.bind(LoggerFactory.java:112)
在org.slf4j.LoggerFactory.performinization上(LoggerFactory.java:105)
位于org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:235)
位于org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:208)
位于org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:221)
位于com.shootoff.Main。(Main.java:59)
位于java.lang.Class.forName0(本机方法)
位于java.lang.Class.forName(未知源)
位于com.sun.javafx.application.launchempl.lambda$launchApplicationWithArgs$2(launchempl.java:352)
位于com.sun.javafx.application.PlatformImpl.lambda$runAndWait$7(PlatformImpl.java:326)
位于com.sun.javafx.application.PlatformImpl.lambda$null$5(PlatformImpl.java:295)
位于java.security.AccessController.doPrivileged(本机方法)
位于com.sun.javafx.application.PlatformImpl.lambda$runLater$6(PlatformImpl.java:294)
位于com.sun.glass.ui.invokelateDispatcher$Future.run(invokelateDispatcher.java:95)
在com.sun.glass.ui.win.WinApplication.\u runLoop(本机方法)
位于com.sun.glass.ui.win.WinApplication.lambda$null$4(WinApplication.java:186)
位于java.lang.Thread.run(未知源)
原因:java.lang.ClassNotFoundException:ch.qos.logback.core.joran.spi.JoranException
位于java.net.URLClassLoader.findClass(未知源)
位于java.lang.ClassLoader.loadClass(未知源)
位于java.lang.ClassLoader.loadClass(未知源)
... 还有18个
java.lang.reflect.InvocationTargetException
在sun.reflect.NativeMethodAccessorImpl.invoke0(本机方法)处
位于sun.reflect.NativeMethodAccessorImpl.invoke(未知源)
在sun.reflect.DelegatingMethodAccessorImpl.invoke处(未知源)
位于java.lang.reflect.Method.invoke(未知源)
位于sun.launcher.launchelper$FXHelper.main(未知源)
原因:java.lang.NullPointerException
位于com.sun.javafx.application.LaunchImpl.launchApplicationWithArgs(LaunchImpl.java:383)
位于com.sun.javafx.application.LaunchImpl.launchApplication(LaunchImpl.java:328)
... 还有5个
现在,从我能看出的异常是关于slf4j日志库的。我曾尝试在“配置构建路径”的外部jar部分中包含不同版本的slf4j,但我得到了相同的异常。所以我认为slf4j的版本控制不是这里的问题。此外,在异常中,我可以看到异常发生在以下行中:

私有静态最终记录器Logger=LoggerFactory.getLogger(Main.class)

除此之外,我不知道下一步该怎么办

我已将相关代码粘贴到下面。希望这有助于解决问题。 谢谢

package com.shootoff;
导入com.shootoff.camera.CameraFactory;
导入com.shootoff.camera.cameratypes.optictrackcamera;
导入com.shootoff.camera.cameratypes.PS3EyeCamera;
导入com.shootoff.config.Configuration;
导入com.shootoff.config.ConfigurationException;
导入com.shootoff.gui.controller.ShootOFFController;
导入com.shotoff.headless.headless控制器;
导入com.shootoff.plugins.TextToSpeech;
导入com.shootoff.util.HardwareData;
导入com.shootoff.util.SystemInfo;
导入com.sun.javafx.application.launchempl;
导入edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
导入java.io.BufferedInputStream;
导入java.io.BufferedReader;
导入java.io.File;
导入java.io.FileOutputStream;
导入java.io.IOException;
导入java.io.InputStream;
导入java.io.InputStreamReader;
导入java.io.PrintWriter;
导入java.net.HttpURLConnection;
导入java.net.URL;
导入java.net.UnknownHostException;
导入java.nio.file.Files;
导入java.util.Enumeration;
导入java.util.Optional;
导入java.util.Properties;
导入java.util.jar.JarEntry;
导入java.util.jar.jar文件;
导入java.util.logging.Level;
导入javafx.application.application;
导入javafx.application.Platform;
导入javafx.concurrent.Task;
导入javafx.event.EventHandler;
导入javafx.fxml.fxmloader;
导入javafx.geometry.Pos;
导入javafx.scene.Node;
导入javafx.scene.Parent;
导入javafx.scene.scene;
导入javafx.scene.control.Alert;
导入javafx.scene.control.CheckBox;
导入javafx.scene.control.Label;
导入javafx.scene.control.ProgressBar;
导入javafx.scene.control.ProgressIndicator;
导入javafx.scene.control.Alert.AlertType;
导入javafx.scene.layout.BorderPane;
导入javafx.scene.layout.FlowPane;
导入javafx.scene.layout.HBox;
导入javafx.scene.paint.Color;
导入javafx.stage.model;
导入javafx.stage.stage;
导入nu.pattern.OpenCV;
导入org.slf4j.Logger;
导入org.slf4j.LoggerFactory;
公共类主扩展应用程序{
私有静态最终记录器Logger=LoggerFactory.getLogger(Main.class);
私有静态最终整数最小值\u CPU\u分数\u优秀=4000;
私有静态最终整数最小值\u CPU\u分数\u合格=3000;
专用静态最终最小长度(RAM)为11712L;
专用静态最终最小长闸板通过=4096L;
private static final String POOR\u HARDWARE\u MESSAGE=“硬件状态:POOR——根据我们收集的数据,\n测试可能无法在此计算机上正常运行。”;
private static final String PASSABLE\u HARDWARE\u MESSAGE=“硬件状态:PASSABLE--根据我们收集的数据,\n测试可能在此计算机上正常运行,但可能会错过\n任意快照。”;
私有静态最终字符串优秀\u硬件\u MESSAGE=“硬件状态:E
package com.shootoff;
import com.shootoff.camera.CameraFactory;
import com.shootoff.camera.cameratypes.OptiTrackCamera;
import com.shootoff.camera.cameratypes.PS3EyeCamera;
import com.shootoff.config.Configuration;
import com.shootoff.config.ConfigurationException;
import com.shootoff.gui.controller.ShootOFFController;
import com.shootoff.headless.HeadlessController;
import com.shootoff.plugins.TextToSpeech;
import com.shootoff.util.HardwareData;
import com.shootoff.util.SystemInfo;
import com.sun.javafx.application.LauncherImpl;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.io.BufferedInputStream;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.UnknownHostException;
import java.nio.file.Files;
import java.util.Enumeration;
import java.util.Optional;
import java.util.Properties;
import java.util.jar.JarEntry;
import java.util.jar.JarFile;
import java.util.logging.Level;
import javafx.application.Application;
import javafx.application.Platform;
import javafx.concurrent.Task;
import javafx.event.EventHandler;
import javafx.fxml.FXMLLoader;
import javafx.geometry.Pos;
import javafx.scene.Node;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.control.Alert;
import javafx.scene.control.CheckBox;
import javafx.scene.control.Label;
import javafx.scene.control.ProgressBar;
import javafx.scene.control.ProgressIndicator;
import javafx.scene.control.Alert.AlertType;
import javafx.scene.layout.BorderPane;
import javafx.scene.layout.FlowPane;
import javafx.scene.layout.HBox;
import javafx.scene.paint.Color;
import javafx.stage.Modality;
import javafx.stage.Stage;
import nu.pattern.OpenCV;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class Main extends Application {
    private static final Logger logger = LoggerFactory.getLogger(Main.class);
    private static final int MINIMUM_CPU_SCORE_EXCELLENT = 4000;
    private static final int MINIMUM_CPU_SCORE_PASSABLE = 3000;
    private static final long MINIMUM_RAM_EXCELLENT = 11712L;
    private static final long MINIMUM_RAM_PASSABLE = 4096L;
    private static final String POOR_HARDWARE_MESSAGE = "Hardware Status: Poor -- Based on the data we gathered,\nMATS will likely not run well on this machine.";
    private static final String PASSABLE_HARDWARE_MESSAGE = "Hardware Status: Passable -- Based on the data we gathered,\nMATS will likely run OK on this machine but may miss\noccasional shots.";
    private static final String EXCELLENT_HARDWARE_MESSAGE = "Hardware Status: Excellent -- Based on the data we gathered,\nthis machine should have no problems running MATS.";
    public static final String SHOOTOFF_DOMAIN = "http://shootoffapp.com/";
    private boolean isJWS = false;
    private static final String RESOURCES_METADATA_NAME = "shootoff-writable-resources.xml";
    private static final String RESOURCES_JAR_NAME = "shootoff-writable-resources.jar";
    private File resourcesMetadataFile;
    private File resourcesJARFile;
    private Stage primaryStage;
    private static final String VERSION_METADATA_NAME = "shootoff-version.xml";
    private static Optional<String> version = Optional.empty();
    private static boolean shouldShowV4lWarning = false;
    public static final String SPLASH_IMAGE = "http://fxexperience.com/wp-content/uploads/2010/06/logo.png";
    private static final int SPLASH_WIDTH = 676;
    private static final int SPLASH_HEIGHT = 227;