1

我刚开始在我的一个项目中使用 NetBeans,我的 GUI 中需要一个仪表。我遇到了看起来很有前途的Steelseries,并下载了这个 JAR 文件:

http://www.java2s.com/Code/Jar/s/DownloadSteelSeries3926jar.htm

我创建了一个 Java 项目,将库添加到其中,并添加了 Swing 调色板。一些 bean 喜欢Lightbulb, Led, 并且TrafficLight工作正常;但是当我选择一个仪表时,我得到了这个错误:

“无法从 JAR 文件加载组件类 eu.hansolo.steelseries.extras.Radar。类本身已找到,但初始化它时出现问题,例如,由于静态初始化程序中的异常,或加载所需的附加类失败组件类。”

异常堆栈跟踪如下:

java.lang.NoClassDefFoundError: org/pushingpixels/trident/ease/TimelineEase
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:348)
    at org.netbeans.modules.form.project.ClassPathUtils.loadClass(ClassPathUtils.java:114)
    at org.netbeans.modules.form.MetaComponentCreator$5.run(MetaComponentCreator.java:1450)
    at org.netbeans.modules.form.FormLAF$2.run(FormLAF.java:293)
    at org.netbeans.modules.openide.util.NbMutexEventProvider$Event.doEventAccess(NbMutexEventProvider.java:138)
    at org.netbeans.modules.openide.util.NbMutexEventProvider$Event.readAccess(NbMutexEventProvider.java:98)
    at org.netbeans.modules.openide.util.LazyMutexImplementation.readAccess(LazyMutexImplementation.java:94)
    at org.openide.util.Mutex.readAccess(Mutex.java:250)
    at org.netbeans.modules.form.FormLAF.executeWithLookAndFeel(FormLAF.java:276)
    at org.netbeans.modules.form.MetaComponentCreator.prepareClass(MetaComponentCreator.java:1446)
    at org.netbeans.modules.form.MetaComponentCreator.precreateVisualComponent(MetaComponentCreator.java:258)
    at org.netbeans.modules.form.MetaComponentCreator.precreateVisualComponent(MetaComponentCreator.java:298)
    at org.netbeans.modules.form.HandleLayer$NewComponentDrag.init(HandleLayer.java:3369)
    at org.netbeans.modules.form.HandleLayer$NewComponentDrag.<init>(HandleLayer.java:3361)
    at org.netbeans.modules.form.HandleLayer$NewComponentDropListener.dragEnter(HandleLayer.java:3658)
    at java.awt.dnd.DropTarget.dragEnter(DropTarget.java:358)
    at sun.awt.dnd.SunDropTargetContextPeer.processEnterMessage(SunDropTargetContextPeer.java:331)
    at sun.awt.dnd.SunDropTargetContextPeer$EventDispatcher.dispatchEnterEvent(SunDropTargetContextPeer.java:799)
    at sun.awt.dnd.SunDropTargetContextPeer$EventDispatcher.dispatchEvent(SunDropTargetContextPeer.java:767)
    at sun.awt.dnd.SunDropTargetEvent.dispatch(SunDropTargetEvent.java:48)
    at java.awt.Component.dispatchEventImpl(Component.java:4746)
    at java.awt.Container.dispatchEventImpl(Container.java:2294)
    at java.awt.Component.dispatchEvent(Component.java:4713)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4888)
    at java.awt.LightweightDispatcher.retargetMouseEnterExit(Container.java:4676)
    at java.awt.LightweightDispatcher.trackDropTargetEnterExit(Container.java:4625)
    at java.awt.LightweightDispatcher.trackMouseEnterExit(Container.java:4638)
    at java.awt.LightweightDispatcher.processDropTargetEvent(Container.java:4591)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4461)
    at java.awt.Container.dispatchEventImpl(Container.java:2280)
    at java.awt.Window.dispatchEventImpl(Window.java:2750)
    at java.awt.Component.dispatchEvent(Component.java:4713)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
    at java.awt.EventQueue.access$500(EventQueue.java:97)
    at java.awt.EventQueue$3.run(EventQueue.java:709)
    at java.awt.EventQueue$3.run(EventQueue.java:703)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
    at java.awt.EventQueue$4.run(EventQueue.java:731)
    at java.awt.EventQueue$4.run(EventQueue.java:729)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
    at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:159)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
Caused by: java.lang.ClassNotFoundException: org.pushingpixels.trident.ease.TimelineEase
    at org.netbeans.modules.form.project.ProjectClassLoader.findClass(ProjectClassLoader.java:188)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    ... 52 more
4

1 回答 1

1

SteelSeries, 最初托管于Kenai, 已移至GitHub. 该项目取决于Trident库,如此pom.xml.

你也知道为什么Steelseries图书馆缺少那些需要的模块吗?

您提到的链接引用了预构建的 JAR 文件,每个文件都不包括此处看到的依赖目录lib此处引用的工件参考。您未来采取的确切方法将取决于您的软件配置管理计划。

于 2016-07-18T16:06:43.393 回答