目前,我正在使用智能卡开发用于电子签名文档的java applet,服务器端的当前applet代码如下所示
echo "<Applet Code=\"Main.class\"
name = \"eParakstitajs\"
mayscript=\"true\"
codebase = \"".SERVER_FULL_URL."/EDOC2.4.0._22.05\"
archive = \"
classesEDOC2.4.jar,
log4j-1.2.17.jar,
eparaksts-bc-1.43.0.jar,
eparaksts-client-2.4.0.jar,
eparaksts-lib-2.4.0.jar,
org.apache.commons.codec_1.3.0.v201101211617.jar,
pkcs11wrapper-1.2.18.jar,
plugin.jar,
signing-applet-2.4.0.jar,
slf4j-api-1.7.7.jar,
slf4j-log4j12-1.7.7.jar,
xmlsec-2.0.2.jar,
./config/\"
width=1
Height=1
>
<PARAM NAME=\"key\" VALUE=\"{$signKey}\">
<PARAM NAME=\"URL\" VALUE=\"".SERVER_FULL_URL."\">
<PARAM NAME=\"PIN1\" VALUE=\"{$_SESSION["userdata"]["PIN1"]}\">
<PARAM NAME=\"PIN2\" VALUE=\"{$_SESSION["userdata"]["PIN2"]}\">
<PARAM NAME=\"USERID\" VALUE=\"{$user[0]["id_lietotajs"]}\">
</Applet>";
在这个阶段一切正常,所有列出的库都在提到的文件夹中。 (ClassesEDOC2.4.jar是我的归档类,其他所有都是第三方jar)
在我的java代码中,我基于来自jar eparaksts-lib-2.4.0.jar的类QualifiedSignatureHelper实例化对象。在执行期间,会出现异常
java.lang.NoClassDefFoundError: org/apache/log4j/Logger
at lv.eparaksts.helpers.QualifiedSignatureHelper.<clinit>(QualifiedSignatureHelper.java:26)
at CreateNewSignTimestampedAction.CreateNewSignTimestamped(CreateNewSignTimestampedAction.java:128)
at Main.init(Main.java:221)
at com.sun.deploy.uitoolkit.impl.awt.AWTAppletAdapter.init(Unknown Source)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: org.apache.log4j.Logger
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 6 more
我已经反编译了QualifiedSignatureHelper类,发现它导入了log4j类,并且出于某些原因也实例化了log4j对象
根据例外,QualifiedSignatureHelper类无法找到log4j类。有什么建议吗?