Error using the Ikonli font library java.lang.UnsupportedOperationException

See original GitHub issue

Follow the font instructions from https://aalmiray.github.io/ikonli/

I use two dependencies for my javafx as follows

<dependency>
        <groupId>org.kordamp.ikonli</groupId>
        <artifactId>ikonli-javafx</artifactId>
        <version>1.9.0</version>
    </dependency>
    <dependency>
        <groupId>org.kordamp.ikonli</groupId>
        <artifactId>ikonli-fontawesome-pack</artifactId>
        <version>1.9.0</version>
    </dependency>

My XML file

<?xml version="1.0" encoding="UTF-8"?>

<?import javafx.scene.control.Button?>
<?import javafx.scene.layout.VBox?>
<?import org.kordamp.ikonli.javafx.FontIcon?>

<VBox id="VBox" xmlns="http://javafx.com/javafx/8.0.141" xmlns:fx="http://javafx.com/fxml/1" fx:controller="touya.akira.parser.ParserPresenter">
   <children>
       <Button mnemonicParsing="false">
         <graphic>
            <FontIcon iconLiteral="fa-address-book" />
         </graphic>
       </Button>
   </children>
</VBox>

ERROR


--- exec-maven-plugin:1.2.1:exec (default-cli) @ Touya-Akira ---
Exception in Application start method
java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:389)
    at com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:328)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:767)
Caused by: java.lang.RuntimeException: Exception in Application start method
    at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:917)
    at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$155(LauncherImpl.java:182)
    at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.IllegalStateException: Cannot load touya.akira.parser.parser
    at com.airhacks.afterburner.views.FXMLView.loadSynchronously(FXMLView.java:101)
    at com.airhacks.afterburner.views.FXMLView.initializeFXMLLoader(FXMLView.java:125)
    at com.airhacks.afterburner.views.FXMLView.getView(FXMLView.java:137)
    at touya.akira.MainApp.start(MainApp.java:16)
    at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$162(LauncherImpl.java:863)
    at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$175(PlatformImpl.java:326)
    at com.sun.javafx.application.PlatformImpl.lambda$null$173(PlatformImpl.java:295)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sun.javafx.application.PlatformImpl.lambda$runLater$174(PlatformImpl.java:294)
    at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
    at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
    at com.sun.glass.ui.win.WinApplication.lambda$null$148(WinApplication.java:191)
    ... 1 more
Caused by: javafx.fxml.LoadException: 
file:/E:/Java/NetBeansProjects/Touya-Akira/main/1.0.6/Touya-Akira/target/Touya-Akira-1.0.6.jar!/touya/akira/parser/parser.fxml:13

    at javafx.fxml.FXMLLoader.constructLoadException(FXMLLoader.java:2601)
    at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2579)
    at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2441)
    at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2409)
    at com.airhacks.afterburner.views.FXMLView.loadSynchronously(FXMLView.java:99)
    ... 12 more
Caused by: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
    at com.sun.javafx.fxml.BeanAdapter.put(BeanAdapter.java:262)
    at com.sun.javafx.fxml.BeanAdapter.put(BeanAdapter.java:54)
    at javafx.fxml.FXMLLoader$Element.applyProperty(FXMLLoader.java:512)
    at javafx.fxml.FXMLLoader$Element.processValue(FXMLLoader.java:363)
    at javafx.fxml.FXMLLoader$Element.processPropertyAttribute(FXMLLoader.java:325)
    at javafx.fxml.FXMLLoader$Element.processInstancePropertyAttributes(FXMLLoader.java:235)
    at javafx.fxml.FXMLLoader$ValueElement.processEndElement(FXMLLoader.java:767)
    at javafx.fxml.FXMLLoader.processEndElement(FXMLLoader.java:2823)
    at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2532)
    ... 15 more
Caused by: java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:71)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:275)
    at com.sun.javafx.fxml.BeanAdapter.put(BeanAdapter.java:258)
    ... 23 more
Caused by: java.lang.UnsupportedOperationException: Cannot resolve 'fa-circle-thin'
    at org.kordamp.ikonli.javafx.IkonResolver.resolveIkonHandler(IkonResolver.java:60)
    at org.kordamp.ikonli.javafx.FontIcon.setIconLiteral(FontIcon.java:232)
    ... 34 more
Exception running application touya.akira.MainApp
------------------------------------------------------------------------
BUILD FAILURE
------------------------------------------------------------------------
Total time: 5.914s
Finished at: Fri Sep 29 08:49:05 ICT 2017
Final Memory: 14M/35M
But if I use dependencies

<dependency>
    <groupId>org.kordamp.ikonli</groupId>
    <artifactId>ikonli-devicons-pack</artifactId>
    <version>1.9.0</version>
</dependency>

<FontIcon iconLiteral="di-android" />

then it can work but with other dependencies i try it the above error appears

What am I missing here? What should I do to make this work? Please help me

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:19

github_iconTop GitHub Comments

9reactions
leonloglicommented, Dec 26, 2018

Problem solved

For maven-shade-plugin users, add this to your transformers

<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>

For more information about Resource Transformers, refer to this page

8reactions
nilsreitercommented, Feb 21, 2018

I had the same issue, but only when I packaged a jar file using the maven-shade-plugin, and not in Eclipse. I was able to solve it by including the icon pack dependency before the core and swing dependencies. I don’t exactly understand why though, but maybe it helps.

Read more comments on GitHub >

github_iconTop Results From Across the Web

What else am I missing to load service providers using the ...
What I was missing was requiring fontawesome5 in the module-info.java of my application: requires org.kordamp.ikonli.fontawesome5;.
Read more >
Icon packs for Java applications - Kordamp
FontIcon exposes properties that can be styled using CSS. It defines a node class named ikonli-font-icon . -fx-icon-code. An icon ...
Read more >
JavaFX Tip 32: Need Icons? Use Ikonli! - DLSC
Icon Fonts. Luckily for all of us the web has already come up with a solution for this problem, and the solution is...
Read more >
JRebel by Perforce på Twitter: "ANNOUNCEMENT: XRebel Hub has ...
I read the article about your Ikonli I enjoyed it, there is a problem when using it expect you help me https://stackoverflow.com/questions/46480696/error-using- ......
Read more >
Java.Lang.Noclassdeffounderror When I Add Font Aweasome ...
Error using the Ikonli font library java.lang.UnsupportedOperationException. Follow the font instructions from https://aalmiray.github.io/ikonli/. I.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found