2017-03-08 62 views
0

当我输入fontawesomefx-commons.jar(版本8.15)到现场Builder和运行JAR分析,我得到这些错误:与场景生成器fontawesomefx问题

Exception for: de/jensd/fx/glyphs/GlyphIcon.class 
javafx.fxml.LoadException: 
unknown path:2 

    at javafx.fxml.FXMLLoader.constructLoadException(FXMLLoader.java:2617) 
    at javafx.fxml.FXMLLoader.access$700(FXMLLoader.java:104) 
    at javafx.fxml.FXMLLoader$InstanceDeclarationElement.constructValue(FXMLLoader.java:1012) 
    at javafx.fxml.FXMLLoader$ValueElement.processStartElement(FXMLLoader.java:740) 
    at javafx.fxml.FXMLLoader.processStartElement(FXMLLoader.java:2723) 
    at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2527) 
    at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2425) 
    at com.oracle.javafx.scenebuilder.kit.library.util.JarExplorer.instantiateWithFXMLLoader(JarExplorer.java:105) 
    at com.oracle.javafx.scenebuilder.kit.library.util.JarExplorer.exploreEntry(JarExplorer.java:146) 
    at com.oracle.javafx.scenebuilder.kit.library.util.JarExplorer.explore(JarExplorer.java:65) 
    at com.oracle.javafx.scenebuilder.kit.library.user.LibraryFolderWatcher.exploreAndUpdateLibrary(LibraryFolderWatcher.java:298) 
    at com.oracle.javafx.scenebuilder.kit.library.user.LibraryFolderWatcher.runWatching(LibraryFolderWatcher.java:192) 
    at com.oracle.javafx.scenebuilder.kit.library.user.LibraryFolderWatcher.run(LibraryFolderWatcher.java:89) 
    at java.lang.Thread.run(Thread.java:744) 
Caused by: java.lang.InstantiationException: de.jensd.fx.glyphs.GlyphIcon 
    at java.lang.Class.newInstance(Class.java:418) 
    at sun.reflect.misc.ReflectUtil.newInstance(ReflectUtil.java:51) 
    at javafx.fxml.FXMLLoader$InstanceDeclarationElement.constructValue(FXMLLoader.java:1010) 
    ... 11 more 
Caused by: java.lang.NoSuchMethodException: de.jensd.fx.glyphs.GlyphIcon.<init>() 
    at java.lang.Class.getConstructor0(Class.java:2971) 
    at java.lang.Class.newInstance(Class.java:403) 
    ... 13 more 


Exception for: de/jensd/fx/glyphs/GlyphIcons.class 
javafx.fxml.LoadException: 
unknown path:2 

    at javafx.fxml.FXMLLoader.constructLoadException(FXMLLoader.java:2617) 
    at javafx.fxml.FXMLLoader.access$700(FXMLLoader.java:104) 
    at javafx.fxml.FXMLLoader$InstanceDeclarationElement.constructValue(FXMLLoader.java:1012) 
    at javafx.fxml.FXMLLoader$ValueElement.processStartElement(FXMLLoader.java:740) 
    at javafx.fxml.FXMLLoader.processStartElement(FXMLLoader.java:2723) 
    at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2527) 
    at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2425) 
    at com.oracle.javafx.scenebuilder.kit.library.util.JarExplorer.instantiateWithFXMLLoader(JarExplorer.java:105) 
    at com.oracle.javafx.scenebuilder.kit.library.util.JarExplorer.exploreEntry(JarExplorer.java:146) 
    at com.oracle.javafx.scenebuilder.kit.library.util.JarExplorer.explore(JarExplorer.java:65) 
    at com.oracle.javafx.scenebuilder.kit.library.user.LibraryFolderWatcher.exploreAndUpdateLibrary(LibraryFolderWatcher.java:298) 
    at com.oracle.javafx.scenebuilder.kit.library.user.LibraryFolderWatcher.runWatching(LibraryFolderWatcher.java:192) 
    at com.oracle.javafx.scenebuilder.kit.library.user.LibraryFolderWatcher.run(LibraryFolderWatcher.java:89) 
    at java.lang.Thread.run(Thread.java:744) 
Caused by: java.lang.InstantiationException: de.jensd.fx.glyphs.GlyphIcons 
    at java.lang.Class.newInstance(Class.java:418) 
    at sun.reflect.misc.ReflectUtil.newInstance(ReflectUtil.java:51) 
    at javafx.fxml.FXMLLoader$InstanceDeclarationElement.constructValue(FXMLLoader.java:1010) 
    ... 11 more 
Caused by: java.lang.NoSuchMethodException: de.jensd.fx.glyphs.GlyphIcons.<init>() 
    at java.lang.Class.getConstructor0(Class.java:2971) 
    at java.lang.Class.newInstance(Class.java:403) 
    ... 13 more 


Exception for: de/jensd/fx/glyphs/GlyphsBuilder.class 
javafx.fxml.LoadException: 
unknown path:2 

    at javafx.fxml.FXMLLoader.constructLoadException(FXMLLoader.java:2617) 
    at javafx.fxml.FXMLLoader.access$700(FXMLLoader.java:104) 
    at javafx.fxml.FXMLLoader$InstanceDeclarationElement.constructValue(FXMLLoader.java:1012) 
    at javafx.fxml.FXMLLoader$ValueElement.processStartElement(FXMLLoader.java:740) 
    at javafx.fxml.FXMLLoader.processStartElement(FXMLLoader.java:2723) 
    at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2527) 
    at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2425) 
    at com.oracle.javafx.scenebuilder.kit.library.util.JarExplorer.instantiateWithFXMLLoader(JarExplorer.java:105) 
    at com.oracle.javafx.scenebuilder.kit.library.util.JarExplorer.exploreEntry(JarExplorer.java:146) 
    at com.oracle.javafx.scenebuilder.kit.library.util.JarExplorer.explore(JarExplorer.java:65) 
    at com.oracle.javafx.scenebuilder.kit.library.user.LibraryFolderWatcher.exploreAndUpdateLibrary(LibraryFolderWatcher.java:298) 
    at com.oracle.javafx.scenebuilder.kit.library.user.LibraryFolderWatcher.runWatching(LibraryFolderWatcher.java:192) 
    at com.oracle.javafx.scenebuilder.kit.library.user.LibraryFolderWatcher.run(LibraryFolderWatcher.java:89) 
    at java.lang.Thread.run(Thread.java:744) 
Caused by: java.lang.InstantiationException: de.jensd.fx.glyphs.GlyphsBuilder 
    at java.lang.Class.newInstance(Class.java:418) 
    at sun.reflect.misc.ReflectUtil.newInstance(ReflectUtil.java:51) 
    at javafx.fxml.FXMLLoader$InstanceDeclarationElement.constructValue(FXMLLoader.java:1010) 
    ... 11 more 
Caused by: java.lang.NoSuchMethodException: de.jensd.fx.glyphs.GlyphsBuilder.<init>() 
    at java.lang.Class.getConstructor0(Class.java:2971) 
    at java.lang.Class.newInstance(Class.java:403) 
    ... 13 more 


Exception for: de/jensd/fx/glyphs/GlyphsFactory.class 
javafx.fxml.LoadException: 
unknown path:2 

    at javafx.fxml.FXMLLoader.constructLoadException(FXMLLoader.java:2617) 
    at javafx.fxml.FXMLLoader.access$700(FXMLLoader.java:104) 
    at javafx.fxml.FXMLLoader$InstanceDeclarationElement.constructValue(FXMLLoader.java:1012) 
    at javafx.fxml.FXMLLoader$ValueElement.processStartElement(FXMLLoader.java:740) 
    at javafx.fxml.FXMLLoader.processStartElement(FXMLLoader.java:2723) 
    at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2527) 
    at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2425) 
    at com.oracle.javafx.scenebuilder.kit.library.util.JarExplorer.instantiateWithFXMLLoader(JarExplorer.java:105) 
    at com.oracle.javafx.scenebuilder.kit.library.util.JarExplorer.exploreEntry(JarExplorer.java:146) 
    at com.oracle.javafx.scenebuilder.kit.library.util.JarExplorer.explore(JarExplorer.java:65) 
    at com.oracle.javafx.scenebuilder.kit.library.user.LibraryFolderWatcher.exploreAndUpdateLibrary(LibraryFolderWatcher.java:298) 
    at com.oracle.javafx.scenebuilder.kit.library.user.LibraryFolderWatcher.runWatching(LibraryFolderWatcher.java:192) 
    at com.oracle.javafx.scenebuilder.kit.library.user.LibraryFolderWatcher.run(LibraryFolderWatcher.java:89) 
    at java.lang.Thread.run(Thread.java:744) 
Caused by: java.lang.InstantiationException: de.jensd.fx.glyphs.GlyphsFactory 
    at java.lang.Class.newInstance(Class.java:418) 
    at sun.reflect.misc.ReflectUtil.newInstance(ReflectUtil.java:51) 
    at javafx.fxml.FXMLLoader$InstanceDeclarationElement.constructValue(FXMLLoader.java:1010) 
    ... 11 more 
Caused by: java.lang.NoSuchMethodException: de.jensd.fx.glyphs.GlyphsFactory.<init>() 
    at java.lang.Class.getConstructor0(Class.java:2971) 
    at java.lang.Class.newInstance(Class.java:403) 
    ... 13 more 


Exception for: de/jensd/fx/glyphs/GlyphsStyle.class 
javafx.fxml.LoadException: 
unknown path:2 

    at javafx.fxml.FXMLLoader.constructLoadException(FXMLLoader.java:2617) 
    at javafx.fxml.FXMLLoader.access$700(FXMLLoader.java:104) 
    at javafx.fxml.FXMLLoader$InstanceDeclarationElement.constructValue(FXMLLoader.java:1012) 
    at javafx.fxml.FXMLLoader$ValueElement.processStartElement(FXMLLoader.java:740) 
    at javafx.fxml.FXMLLoader.processStartElement(FXMLLoader.java:2723) 
    at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2527) 
    at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2425) 
    at com.oracle.javafx.scenebuilder.kit.library.util.JarExplorer.instantiateWithFXMLLoader(JarExplorer.java:105) 
    at com.oracle.javafx.scenebuilder.kit.library.util.JarExplorer.exploreEntry(JarExplorer.java:146) 
    at com.oracle.javafx.scenebuilder.kit.library.util.JarExplorer.explore(JarExplorer.java:65) 
    at com.oracle.javafx.scenebuilder.kit.library.user.LibraryFolderWatcher.exploreAndUpdateLibrary(LibraryFolderWatcher.java:298) 
    at com.oracle.javafx.scenebuilder.kit.library.user.LibraryFolderWatcher.runWatching(LibraryFolderWatcher.java:192) 
    at com.oracle.javafx.scenebuilder.kit.library.user.LibraryFolderWatcher.run(LibraryFolderWatcher.java:89) 
    at java.lang.Thread.run(Thread.java:744) 
Caused by: java.lang.InstantiationException: de.jensd.fx.glyphs.GlyphsStyle 
    at java.lang.Class.newInstance(Class.java:418) 
    at sun.reflect.misc.ReflectUtil.newInstance(ReflectUtil.java:51) 
    at javafx.fxml.FXMLLoader$InstanceDeclarationElement.constructValue(FXMLLoader.java:1010) 
    ... 11 more 
Caused by: java.lang.NoSuchMethodException: de.jensd.fx.glyphs.GlyphsStyle.<init>() 
    at java.lang.Class.getConstructor0(Class.java:2971) 
    at java.lang.Class.newInstance(Class.java:403) 
    ... 13 more 


Exception for: de/jensd/fx/glyphs/GlyphStackIcon.class 
javafx.fxml.LoadException: 
unknown path:2 

    at javafx.fxml.FXMLLoader.constructLoadException(FXMLLoader.java:2617) 
    at javafx.fxml.FXMLLoader.access$700(FXMLLoader.java:104) 
    at javafx.fxml.FXMLLoader$InstanceDeclarationElement.constructValue(FXMLLoader.java:1012) 
    at javafx.fxml.FXMLLoader$ValueElement.processStartElement(FXMLLoader.java:740) 
    at javafx.fxml.FXMLLoader.processStartElement(FXMLLoader.java:2723) 
    at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2527) 
    at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2425) 
    at com.oracle.javafx.scenebuilder.kit.library.util.JarExplorer.instantiateWithFXMLLoader(JarExplorer.java:105) 
    at com.oracle.javafx.scenebuilder.kit.library.util.JarExplorer.exploreEntry(JarExplorer.java:146) 
    at com.oracle.javafx.scenebuilder.kit.library.util.JarExplorer.explore(JarExplorer.java:65) 
    at com.oracle.javafx.scenebuilder.kit.library.user.LibraryFolderWatcher.exploreAndUpdateLibrary(LibraryFolderWatcher.java:298) 
    at com.oracle.javafx.scenebuilder.kit.library.user.LibraryFolderWatcher.runWatching(LibraryFolderWatcher.java:192) 
    at com.oracle.javafx.scenebuilder.kit.library.user.LibraryFolderWatcher.run(LibraryFolderWatcher.java:89) 
    at java.lang.Thread.run(Thread.java:744) 
Caused by: java.lang.InstantiationException 
    at sun.reflect.InstantiationExceptionConstructorAccessorImpl.newInstance(InstantiationExceptionConstructorAccessorImpl.java:48) 
    at java.lang.reflect.Constructor.newInstance(Constructor.java:408) 
    at java.lang.Class.newInstance(Class.java:433) 
    at sun.reflect.misc.ReflectUtil.newInstance(ReflectUtil.java:51) 
    at javafx.fxml.FXMLLoader$InstanceDeclarationElement.constructValue(FXMLLoader.java:1010) 
    ... 11 more 


Exception for: de/jensd/fx/glyphs/GlyphStackIcons.class 
javafx.fxml.LoadException: 
unknown path:2 

    at javafx.fxml.FXMLLoader.constructLoadException(FXMLLoader.java:2617) 
    at javafx.fxml.FXMLLoader.access$700(FXMLLoader.java:104) 
    at javafx.fxml.FXMLLoader$InstanceDeclarationElement.constructValue(FXMLLoader.java:1012) 
    at javafx.fxml.FXMLLoader$ValueElement.processStartElement(FXMLLoader.java:740) 
    at javafx.fxml.FXMLLoader.processStartElement(FXMLLoader.java:2723) 
    at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2527) 
    at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2425) 
    at com.oracle.javafx.scenebuilder.kit.library.util.JarExplorer.instantiateWithFXMLLoader(JarExplorer.java:105) 
    at com.oracle.javafx.scenebuilder.kit.library.util.JarExplorer.exploreEntry(JarExplorer.java:146) 
    at com.oracle.javafx.scenebuilder.kit.library.util.JarExplorer.explore(JarExplorer.java:65) 
    at com.oracle.javafx.scenebuilder.kit.library.user.LibraryFolderWatcher.exploreAndUpdateLibrary(LibraryFolderWatcher.java:298) 
    at com.oracle.javafx.scenebuilder.kit.library.user.LibraryFolderWatcher.runWatching(LibraryFolderWatcher.java:192) 
    at com.oracle.javafx.scenebuilder.kit.library.user.LibraryFolderWatcher.run(LibraryFolderWatcher.java:89) 
    at java.lang.Thread.run(Thread.java:744) 
Caused by: java.lang.InstantiationException: de.jensd.fx.glyphs.GlyphStackIcons 
    at java.lang.Class.newInstance(Class.java:418) 
    at sun.reflect.misc.ReflectUtil.newInstance(ReflectUtil.java:51) 
    at javafx.fxml.FXMLLoader$InstanceDeclarationElement.constructValue(FXMLLoader.java:1010) 
    ... 11 more 
Caused by: java.lang.NoSuchMethodException: de.jensd.fx.glyphs.GlyphStackIcons.<init>() 
    at java.lang.Class.getConstructor0(Class.java:2971) 
    at java.lang.Class.newInstance(Class.java:403) 
    ... 13 more 

有谁知道为什么会发生。我在项目中添加了对POM的依赖关系,并且在代码中设置了它的图标。我想通过Scene Builder来做,所以我可以看到GUI。

回答

1

它看起来像SceneBuilder希望GlyphIcon提供一个无参数构造函数,但该特定版本的类定义了一个至少需要一个参数的构造函数。

Ikonli(http://aalmiray.github.io/ikonli/)的行为与FontAwesomeFX类似,但具有更多图标。

+0

感谢您的建议。我删除了fontawesomefx jar并将ikonli jar添加到了Scene Builder,并且我得到了类似的行为: 异常:org/kordamp/ikonli/javafx/FontIcon.class java.io.IOException:java.lang.NoClassDefFoundError:org/kordamp/ikonli /依康 \t在com.oracle.javafx.scenebuilder.kit.library.util.JarExplorer.instantiateWithFXMLLoader(JarExplorer.java:109) \t在com.oracle.javafx.scenebuilder.kit.library.util.JarExplorer .exploreEntry(JarExplorer.java:146) \t at – Mensur

+1

当我将ikonli-core添加到Scene Builder后,它也起作用了。感谢您的建议。 – Mensur

+0

对。 Ikonli遵循模块化设计并针对Swing和JavaFX。一旦你选择了-core和-javafx deps,你只需要选择使用哪个图标包:-) – aalmiray