Java Applet在Netbeans中运行,但不会在浏览器中运行

时间:2012-02-17 18:10:11

标签: java applet noclassdeffounderror

我用Netbeans创建了一个Java applet。它是一个GUI横幅创建者。它在Netbeans applet viewer中运行良好,但是当我使用HTML加载它时,我收到一个错误。它找到了类文件,但后来我得到了:

org/jdesktop/beansbinding/Property
    at sun.plugin2.applet.Plugin2Manager.createApplet(Plugin2Manager.java:3136)
    at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Plugin2Manager.java:1497)
    at java.lang.Thread.run(Thread.java:680)
Caused by: java.lang.NoClassDefFoundError: org/jdesktop/beansbinding/Property
    at java.lang.Class.getDeclaredConstructors0(Native Method)
    at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)
    at java.lang.Class.getConstructor0(Class.java:2699)
    at java.lang.Class.newInstance0(Class.java:326)
    at java.lang.Class.newInstance(Class.java:308)
    at sun.plugin2.applet.Plugin2Manager$13.run(Plugin2Manager.java:3060)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:199)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:677)
    at java.awt.EventQueue.access$000(EventQueue.java:85)
    at java.awt.EventQueue$1.run(EventQueue.java:638)
    at java.awt.EventQueue$1.run(EventQueue.java:636)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:647)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
Caused by: java.lang.ClassNotFoundException: org.jdesktop.beansbinding.Property
    at sun.plugin2.applet.Applet2ClassLoader.findClass(Applet2ClassLoader.java:252)
    at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Plugin2ClassLoader.java:249)
    at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Plugin2ClassLoader.java:179)
    at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Plugin2ClassLoader.java:160)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
    ... 20 more
Exception: java.lang.RuntimeException: java.lang.NoClassDefFoundError: org/jdesktop/beansbinding/Property

我已经阅读了一些我需要右键单击我的项目然后转到库的地方。一旦我在那里,我确实安装了Beans Binding Library。还有其他地方安装了beans.jar文件(我有)。

如何解决此运行时异常?

1 个答案:

答案 0 :(得分:1)

Caused by: java.lang.NoClassDefFoundError: org/jdesktop/beansbinding/Property

将包含org.jdesktop.beansbinding.Property类的Jar添加到archive元素的applet属性。