好吧,我正在使用 vaadin AppletIntegration Addon 将我的录音机小程序与我的 vaadin 项目集成。这是代码:
AppletIntegration applet = new AppletIntegration() {
private static final long serialVersionUID = 1L;
@Override
public void attach() {
System.out.println("In attach functions");
setAppletArchives(Arrays.asList(new String[] { "SoundRecordingJar.jar" }));
setCodebase(path);
setAppletClass("AudioApplet.class");
setWidth("800px");
setHeight("500px");
}
};
mainWindow.addComponent(applet);
当我在浏览器中运行它时:它给了我以下异常:
java.lang.ClassFormatError: Incompatible magic value 1008813135 in class file AudioApplet
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(Unknown Source)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unknown Source)
at sun.plugin2.applet.Plugin2Manager.initAppletAdapter(Unknown Source)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
如果我使用 html 文件运行相同的小程序,它可以正常工作,无一例外。小程序也已签名。
那么,这个错误是什么意思以及如何解决它。