当我通过 JWS 启动我的应用程序时出现以下异常。但是当作为没有 JNLP 的独立 Java 应用程序启动时,它工作得很好。
Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory
at com.xuggle.ferry.JNIMemoryManager.<init>(JNIMemoryManager.java:861)
at com.xuggle.ferry.JNIMemoryManager.<clinit>(JNIMemoryManager.java:860)
at com.xuggle.mediatool.MediaWriter.<clinit>(MediaWriter.java:119)
at com.xuggle.mediatool.ToolFactory.makeWriter(ToolFactory.java:149)
这是 JNLP:
<?xml version="1.0" encoding="UTF-8"?>
<jnlp spec="1.0+" codebase="http://localhost/MyApp" href="MyAppLauncher.jnlp">
<information>
<title>MyAPP</title>
<vendor>Me</vendor>
</information>
<resources>
<!-- Application Resources -->
<j2se version="1.6+"
href="http://java.sun.com/products/autodl/j2se"/>
<jar href="MyAppJar.jar"
main="true" />
<jar href="xuggle-xuggler.jar" />
<jar href="xuggle-xuggler-test.jar" />
<jar href="slf4j-api-1.6.6.jar" />
</resources>
<application-desc
name="MyApplication"
main-class=
"ApplicationMain"
width="300"
height="300">
</application-desc>
<security>
<all-permissions/>
</security>
<offline-allowed />
<update check="background"/>
</jnlp>
MyApp.jar 包含主类文件。所有使用的 JARS 都已签名。