Bad type on operand stack

Issue #39 open
TheMicfire created an issue

After exporting project to a single jar file with ant build i got the following error when i load a FXML with fontawesomeicons inside into the scene.

Caused by: java.lang.VerifyError: Bad type on operand stack
Exception Details:
  Location:
    de/jensd/fx/glyphs/fontawesome/FontAwesomeIconView.<init>(Lde/jensd/fx/glyphs/fontawesome/FontAwesomeIcon;)V @25: invokevirtual
  Reason:
    Type 'de/jensd/fx/glyphs/fontawesome/FontAwesomeIcon' (current frame, stack[1]) is not assignable to 'java/lang/Enum'
  Current Frame:
    bci: @25
    flags: { }
    locals: { 'de/jensd/fx/glyphs/fontawesome/FontAwesomeIconView', 'de/jensd/fx/glyphs/fontawesome/FontAwesomeIcon' }
    stack: { 'de/jensd/fx/glyphs/fontawesome/FontAwesomeIconView', 'de/jensd/fx/glyphs/fontawesome/FontAwesomeIcon' }
  Bytecode:
    0x0000000: 2ab7 0001 2abb 0002 5912 03b2 0004 b600
    0x0000010: 05b7 0006 b600 072a 2bb6 0008 b1

Comments (5)

  1. TheMicfire reporter

    The error appears only as long as their is an icon in the fxml file after the build with ant. When i set the location to a fxml file without an icon everything is fine. When i start the app out of eclipse with or without icons in the fxml file everthing is fine. I tryed fontawesomefx-8.4, fontawesomefx-8.9, commons-8.12 with fontawesome-4.6.3 .

    Main

    public class Main extends Application {
        public static Stage primaryStage;
        private static BorderPane mainLayout;
        public static konstante konstante;
        public static FXMLLoader loader;
    
        @Override
        public void start(Stage primaryStage) throws IOException, ClassNotFoundException, SQLException, InterruptedException {
            konstante = new konstante();
    
            Thread.sleep(1500);
            Main.primaryStage= primaryStage;
            Main.primaryStage.setTitle(konstante.Programmname);
            Main.primaryStage.setMinWidth(1252);
            Main.primaryStage.setMinHeight(800);
            Main.primaryStage.setWidth(1124);
            Main.primaryStage.setHeight(800);
            Main.primaryStage.setMaxWidth(1124);
            Main.primaryStage.setMaxHeight(800);
            showMainView();
    
    
        }
    
        private void showMainView() throws IOException{
    
            loader = new FXMLLoader();
            loader.setLocation(Main.class.getResource("view/MainView.fxml"));
            mainLayout = loader.load();
            Scene scene = new Scene(mainLayout);
            scene.getStylesheets().add("fastfly/view/MainViewMetro.css");
            primaryStage.setScene(scene);
            primaryStage.show();
    
        }
    
    
        public static void main(String[] args) {
            launch(args);
        }
    }
    

    MainViewController without the declaration of @FXML stuff

    public class MainViewController implements Initializable{
    
        public static FXMLLoader loader;
    
    @Override
        public void initialize(URL location, ResourceBundle resources) {
            try {
                loadUebersicht();
            } catch (IOException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
        }
    
    public void showCenterPane(String location) throws IOException{
    //      FXMLLoader 
            loader = new FXMLLoader();
            loader.setLocation(Main.class.getResource(location));
            AnchorPane pane = loader.load();
    
            if(!CenterPane.getChildren().isEmpty()){
                FadeTransition fo = new FadeTransition(Duration.millis(400),CenterPane.getChildren().get(0));
                fo.setFromValue(1.0);
                fo.setToValue(0.0);
                fo.play();
                fo.setOnFinished(evt -> CenterPane.getChildren().remove(0));
            }
    
            FadeTransition ft = new FadeTransition(Duration.millis(400), pane);
            ft.setFromValue(0.0);
            ft.setToValue(1.0);
            ft.play();
    
            CenterPane.getChildren().add(pane);
            CenterPane.setTopAnchor(pane, 0.0);
            CenterPane.setBottomAnchor(pane, 0.0);
            CenterPane.setLeftAnchor(pane, 0.0);
            CenterPane.setRightAnchor(pane, 0.0);   
    
    
        }
    
        public void loadUebersicht() throws IOException{
            showCenterPane("view/uebersicht/Uebersicht.fxml");
            menu.selectToggle(btnUebersicht);       
        }   
    

    MainView.fxml

    <?xml version="1.0" encoding="UTF-8"?>
    
    <?import de.jensd.fx.glyphs.GlyphsStack?>
    <?import de.jensd.fx.glyphs.fontawesome.FontAwesomeIconView?>
    <?import javafx.geometry.Insets?>
    <?import javafx.scene.control.Accordion?>
    <?import javafx.scene.control.Label?>
    <?import javafx.scene.control.TitledPane?>
    <?import javafx.scene.control.ToggleButton?>
    <?import javafx.scene.control.ToggleGroup?>
    <?import javafx.scene.control.ToolBar?>
    <?import javafx.scene.layout.AnchorPane?>
    <?import javafx.scene.layout.BorderPane?>
    <?import javafx.scene.layout.HBox?>
    <?import javafx.scene.layout.Pane?>
    <?import javafx.scene.layout.VBox?>
    <?import javafx.scene.text.Font?>
    
    <BorderPane id="background" fx:id="BorderPane" prefHeight="768.0" prefWidth="1024.0" xmlns="http://javafx.com/javafx/8.0.60" xmlns:fx="http://javafx.com/fxml/1" fx:controller="fastfly.view.MainViewController">
       <top>
          <ToolBar BorderPane.alignment="TOP_CENTER">
             <BorderPane.margin>
                <Insets />
             </BorderPane.margin>
             <items>
                <Label id="label-title" text="FastFly" textFill="WHITE">
                   <font>
                      <Font name="Segoe UI Bold Italic" size="24.0" />
                   </font>
                   <padding>
                      <Insets left="50.0" />
                   </padding>
                </Label>
                <GlyphsStack />
                <GlyphsStack />
             </items>
          </ToolBar>
          </top>
       <bottom>
             <Pane maxHeight="40.0" minHeight="40.0" prefHeight="40.0" styleClass="footer" BorderPane.alignment="CENTER" />
          </bottom>
       <left>
          <Pane id="leftpane" BorderPane.alignment="CENTER">
             <children>
                <VBox prefHeight="200.0" prefWidth="100.0">
                   <children>
                      <ToggleButton id="togglebutton" fx:id="btnUebersicht" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" mnemonicParsing="false" onAction="#loadUebersicht" prefWidth="150.0" selected="true">
                         <toggleGroup>
                            <ToggleGroup fx:id="menu" />
                         </toggleGroup>
                         <graphic>
                            <HBox spacing="15.0">
                               <children>
                                  <FontAwesomeIconView fill="WHITE" glyphName="DASHBOARD" size="20" />
                                  <Label id="awesomeMenuTitledPane" text="Übersicht" />
                               </children>
                            </HBox>
                         </graphic></ToggleButton>
                      <Accordion>
                        <panes>
                            <TitledPane expanded="false" maxHeight="-Infinity" maxWidth="-Infinity" minWidth="-Infinity" prefWidth="150.0">
                               <content>
                                  <VBox maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" spacing="1.0">
                                     <children>
                                        <ToggleButton fx:id="btnBuchungAktive" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" mnemonicParsing="false" onAction="#loadBuchungAktive" prefWidth="150.0" text="Übersicht" toggleGroup="$menu" />
                                        <ToggleButton fx:id="btnBuchungErstellen" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" mnemonicParsing="false" onAction="#loadBuchungErstellen" prefWidth="150.0" text="Erstellen" toggleGroup="$menu" />
                                     </children>
                                  </VBox>
                               </content>
                               <graphic>
                                  <HBox spacing="10.0">
                                     <children>
                                        <FontAwesomeIconView fill="WHITE" glyphName="FILE_ALT" size="20" />
                                        <Label id="awesomeMenuTitledPane" text="Buchung" />
                                        <GlyphsStack />
                                     </children>
                                  </HBox>
                               </graphic>
                            </TitledPane>
                            <TitledPane expanded="false">
                               <graphic>
                                  <HBox spacing="10.0">
                                     <children>
                                        <FontAwesomeIconView fill="WHITE" glyphName="NEWSPAPER_ALT" size="20" />
                                        <Label id="awesomeMenuTitledPane" text="Angebote/Verträge" />
                                     </children>
                                  </HBox>
                               </graphic>
                               <content>
                                  <ToggleButton fx:id="btnBuchhaltungAngebotevertraege" mnemonicParsing="false" onAction="#loadBuchhaltungAngebotevertraege" text="Übersicht" toggleGroup="$menu" />
                               </content>
                            </TitledPane>
                            <TitledPane fx:id="tpaAnalyse" expanded="false" maxHeight="-Infinity" maxWidth="-Infinity" minWidth="-Infinity" prefWidth="150.0">
                               <content>
                                  <VBox spacing="1.0">
                                     <children>
                                        <Accordion>
                                          <panes>
                                            <TitledPane fx:id="tpaAnalyseKundenzufriedenheit" maxHeight="-Infinity" minHeight="-Infinity" text="Kundenzufriedenheit">
                                                 <content>
                                                    <VBox>
                                                       <children>
                                                          <ToggleButton fx:id="btnAnalyseKundenzufriedenheitUebersicht" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" mnemonicParsing="false" onAction="#loadAnalyseKundenzufriedenheitUebersicht" prefWidth="150.0" text="Übersicht" toggleGroup="$menu" />
                                                          <ToggleButton fx:id="btnAnalyseKundenzufriedenheitFragebogen" mnemonicParsing="false" onAction="#loadAnalyseKundenzufriedenheitFragebogen" text="Fragebogen" toggleGroup="$menu" />
                                                          <ToggleButton fx:id="btnAnalyseKundenzufriedenheitEinstellungen" mnemonicParsing="false" onAction="#loadAnalyseKundenzufriedenheitEinstellungen" text="Fragenkatalog" toggleGroup="$menu" />
                                                       </children>
                                                    </VBox>
                                                 </content>
                                              </TitledPane>
                                            <TitledPane fx:id="tpaAnalyseAngebotablehnung" maxHeight="-Infinity" minHeight="-Infinity" text="Angebotablehnung">
                                                 <content>
                                                    <VBox>
                                                       <children>
                                                          <ToggleButton fx:id="btnAnalyseAngebotablehnungUebersicht" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" mnemonicParsing="false" onAction="#loadAnalyseAngebotablehnungUebersicht" prefWidth="150.0" text="Übersicht" toggleGroup="$menu" />
                                                          <ToggleButton fx:id="btnAnalyseAngebotablehnungGruende" mnemonicParsing="false" onAction="#loadAnalyseAngebotablehnungGruende" text="Ablehnungsgründe" toggleGroup="$menu" />
                                                       </children>
                                                    </VBox>
                                                 </content>
                                              </TitledPane>
                                          </panes>
                                        </Accordion>
                                        <ToggleButton fx:id="btnAnalyseFlugzeugprofitabilitaet" mnemonicParsing="false" onAction="#loadAnalyseFlugzeugprofitabilitaet" text="Flugzeugprofitabilität" toggleGroup="$menu" />
                                     </children>
                                  </VBox>
                               </content>
                               <graphic>
                                  <HBox spacing="10.0">
                                     <children>
                                        <FontAwesomeIconView fill="WHITE" glyphName="LINE_CHART" size="20" />
                                        <Label id="awesomeMenuTitledPane" text="Analysen" />
                                     </children>
                                  </HBox>
                               </graphic>
                            </TitledPane>
                            <TitledPane expanded="false" maxHeight="-Infinity" maxWidth="-Infinity" minWidth="-Infinity" prefWidth="150.0">
                               <content>
                                  <VBox maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" spacing="1.0">
                                     <children>
                                        <ToggleButton fx:id="btnBuchungErstellen11" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" mnemonicParsing="false" onAction="#loadTermineKalender" prefWidth="150.0" text="Kalender">
                                           <toggleGroup>
                                              <ToggleGroup fx:id="menu11" />
                                           </toggleGroup>
                                        </ToggleButton>
                                     </children>
                                  </VBox>
                               </content>
                               <graphic>
                                  <HBox spacing="10.0">
                                     <children>
                                        <FontAwesomeIconView fill="WHITE" glyphName="CALENDAR" size="20" />
                                        <Label id="awesomeMenuTitledPane" text="Termine" />
                                     </children>
                                  </HBox>
                               </graphic>
                            </TitledPane>
                            <TitledPane maxHeight="-Infinity" maxWidth="-Infinity" minWidth="-Infinity" prefWidth="150.0">
                               <content>
                                  <VBox prefHeight="200.0" prefWidth="100.0" spacing="1.0">
                                     <children>
                                        <ToggleButton fx:id="btnKundenUebersicht" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" mnemonicParsing="false" onAction="#loadKundenUebersicht" prefWidth="150.0" text="Übersicht" toggleGroup="$menu" />
                                     </children>
                                  </VBox>
                               </content>
                               <graphic>
                                  <HBox spacing="10.0">
                                     <children>
                                        <FontAwesomeIconView fill="WHITE" glyphName="USERS" size="20.0" />
                                        <Label id="awesomeMenuTitledPane" text="Kunden" />
                                     </children>
                                  </HBox>
                               </graphic>
                            </TitledPane>
                            <TitledPane prefHeight="200.0" prefWidth="200.0">
                               <content>
                                  <VBox prefWidth="150.0" spacing="1.0">
                                     <children>
                                        <ToggleButton fx:id="btnBuchhaltungKostenverfolgung" mnemonicParsing="false" onAction="#loadBuchhaltungKostenverfolgung" text="Kostenverfolgung" toggleGroup="$menu" />
                                     </children>
                                  </VBox>
                               </content>
                               <graphic>
                                  <HBox spacing="10.0">
                                     <children>
                                        <FontAwesomeIconView fill="WHITE" glyphName="MONEY" size="20" />
                                        <Label id="awesomeMenuTitledPane" text="Buchhaltung" />
                                     </children>
                                  </HBox>
                               </graphic>
                            </TitledPane>
                            <TitledPane prefWidth="200.0">
                               <content>
                                  <Accordion>
                                     <panes>
                                        <TitledPane expanded="false" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" text="Flughäfen">
                                           <content>
                                              <VBox alignment="CENTER" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" spacing="1.0">
                                                 <children>
                                                    <ToggleButton fx:id="btnFlughaefenUebersicht" alignment="CENTER_LEFT" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" mnemonicParsing="false" onAction="#loadFlughaefenUerbsicht" prefWidth="150.0" text="Übersicht" toggleGroup="$menu" VBox.vgrow="NEVER" />
                                                    <ToggleButton fx:id="btnFlughafenDetails" alignment="CENTER_LEFT" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" mnemonicParsing="false" onAction="#loadFlughaefenDetails" prefWidth="150.0" text="Details" toggleGroup="$menu" VBox.vgrow="NEVER">
                                                       <padding>
                                                          <Insets bottom="5.0" left="10.0" top="5.0" />
                                                       </padding>
                                                       <VBox.margin>
                                                          <Insets />
                                                       </VBox.margin>
                                                    </ToggleButton>
                                                 </children>
                                              </VBox>
                                           </content>
                                        </TitledPane>
                                        <TitledPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" text="Flugzeuge">
                                           <content>
                                              <VBox alignment="CENTER" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefWidth="150.0" spacing="1.0">
                                                 <children>
                                                    <ToggleButton fx:id="btnFlugzeugeUebersicht" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" mnemonicParsing="false" onAction="#loadFlugzeugeUebersicht" prefWidth="150.0" text="Übersicht" toggleGroup="$menu" />
                                                    <ToggleButton fx:id="btnFlugzeugeDetails" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" mnemonicParsing="false" onAction="#loadFlugzeugeDetails" prefWidth="150.0" text="Details" toggleGroup="$menu" />
                                                    <ToggleButton fx:id="btnFlugzeugeTypen" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" mnemonicParsing="false" onAction="#loadFlugzeugeTypen" prefWidth="150.0" text="Typen" toggleGroup="$menu" />
                                                    <ToggleButton fx:id="btnFlugzeugeHersteller" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" mnemonicParsing="false" onAction="#loadFlugzeugeHersteller" prefWidth="150.0" text="Hersteller" toggleGroup="$menu" />
                                                 </children>
                                              </VBox>
                                           </content>
                                        </TitledPane>
                                        <TitledPane expanded="false" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" text="Mitarbeiter">
                                           <content>
                                              <VBox alignment="TOP_CENTER" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" spacing="1.0">
                                                 <children>
                                                    <ToggleButton fx:id="btnMitarbeiterUebersicht" alignment="CENTER_LEFT" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" mnemonicParsing="false" onAction="#loadMitarbeiterUebersicht" prefWidth="150.0" text="Übersicht" toggleGroup="$menu" />
                                                    <ToggleButton fx:id="btnMitarbeiterDetails" alignment="CENTER_LEFT" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" mnemonicParsing="false" onAction="#loadMitarbeiterDetails" prefWidth="150.0" text="Details" toggleGroup="$menu" />
                                                 </children>
                                              </VBox>
                                           </content>
                                           <font>
                                              <Font name="System Bold" size="12.0" />
                                           </font>
                                        </TitledPane>
                                     </panes>
                                  </Accordion>
                               </content>
                               <graphic>
                                  <HBox spacing="10.0">
                                     <children>
                                        <FontAwesomeIconView fill="WHITE" glyphName="DATABASE" size="20" />
                                        <Label id="awesomeMenuTitledPane" text="Stammdaten" />
                                     </children>
                                  </HBox>
                               </graphic>
                            </TitledPane>
                            <TitledPane prefHeight="200.0" prefWidth="200.0">
                               <graphic>
                                  <HBox spacing="10.0">
                                     <children>
                                        <FontAwesomeIconView fill="WHITE" glyphName="WRENCH" size="20" />
                                        <Label id="awesomeMenuTitledPane" text="Systemeinstellungen" />
                                     </children>
                                  </HBox>
                               </graphic>
                               <content>
                                  <VBox>
                                     <children>
                                      <TitledPane expanded="false" text="Mail">
                                           <content>
                                              <VBox>
                                                 <children>
                                                    <ToggleButton mnemonicParsing="false" onAction="#loadSystemeinstellungenMailStandardmails" text="Standardmails" toggleGroup="$menu" />
                                                    <ToggleButton mnemonicParsing="false" onAction="#loadSystemeinstellungenMailEinstellungen" text="Einstellungen" toggleGroup="$menu" />
                                                 </children>
                                              </VBox>
                                           </content>
                                        </TitledPane>
                                     </children>
                                  </VBox>
                               </content>
                            </TitledPane>
                        </panes>
                      </Accordion>
                   </children>
                </VBox>
             </children></Pane>
       </left>
       <center>
          <AnchorPane id="centerpane" fx:id="CenterPane" BorderPane.alignment="CENTER">
             <BorderPane.margin>
                <Insets />
             </BorderPane.margin>
          </AnchorPane>
       </center>
    </BorderPane>
    
  2. Jens Deters repo owner

    Hm. I don't think this is primary caused by ant (clearly there are reasons you are using ant but did you consider to migrate e.g. to Gradle?).

    Did you verify you build and run with the same Java version? FontAwesomeFX is build with JDK 8!

  3. TheMicfire reporter

    The app runs with the jdk/jre 1.8.0_101. Gradle could be an option but the app itself is almost finished and i have no idea how to migrate the project quirk and dirty. Implementinig the icons is one of the last things on my ToDo.

  4. Log in to comment