gpt4 book ai didi

java - 小程序出现奇怪的 ClassNotFound 错误

转载 作者:行者123 更新时间:2023-12-01 16:01:15 25 4
gpt4 key购买 nike

错误:

java.lang.RuntimeException: java.lang.NoClassDefFoundError: Could not initialize class com.Stuffez.UploadApplet.UploadApplet
at sun.plugin2.applet.Plugin2Manager.createApplet(Plugin2Manager.java:3013)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Plugin2Manager.java:1444)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.NoClassDefFoundError: Could not initialize class com.Stuffez.UploadApplet.UploadApplet
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at java.lang.Class.newInstance0(Class.java:355)
at java.lang.Class.newInstance(Class.java:308)
at sun.plugin2.applet.Plugin2Manager$12.run(Plugin2Manager.java:2955)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:199)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
Exception: java.lang.RuntimeException: java.lang.NoClassDefFoundError: Could not initialize class com.Stuffez.UploadApplet.UploadApplet

我不知道是什么原因造成的,com.Stuffez.UploadApplet.UploadApplet 存在,并且它可以在 Eclipse 中工作...

嵌入代码:

<APPLET archive="UploadApplet.jar" code="com.Stuffez.UploadApplet.UploadApplet" width="200" height="200">
</APPLET>

发生了什么?

最佳答案

造成这种情况的原因是小程序类静态初始化时抛出了一些未经检查的异常,或者是小程序类所依赖的某个类。

实际的根本原因异常未显示在您问题中的堆栈跟踪部分中。它可能位于完整的堆栈跟踪中,也可能位于较早的堆栈跟踪中。

当类初始化期间抛出异常时,JVM 将不会尝试再次初始化该类。它只是报告“无法初始化类...”,但没有告诉您原因。如果您以前从未见过,这可能会相当令人困惑。

关于java - 小程序出现奇怪的 ClassNotFound 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3827220/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com