0 Replies Latest reply: Feb 14, 2013 1:39 AM by user536690 RSS

    java.lang.ClassNotFoundException by FXMLLoader

    user536690
      Hi,

      After update to jdk1.7u13 I got
      Caused by: java.lang.IllegalArgumentException: java.lang.ClassNotFoundException: my/app/Class
           at com.sun.javafx.fxml.BeanAdapter.coerce(BeanAdapter.java:692)
           at com.sun.javafx.fxml.BeanAdapter.put(BeanAdapter.java:428)
           at com.sun.javafx.fxml.BeanAdapter.put(BeanAdapter.java:37)
           at javafx.fxml.FXMLLoader$Element.applyProperty(FXMLLoader.java:464)
           at javafx.fxml.FXMLLoader$Element.processPropertyAttribute(FXMLLoader.java:452)
           at javafx.fxml.FXMLLoader$Element.processInstancePropertyAttributes(FXMLLoader.java:195)
           at javafx.fxml.FXMLLoader$ValueElement.processEndElement(FXMLLoader.java:586)
           at javafx.fxml.FXMLLoader.processEndElement(FXMLLoader.java:2430)
           at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2136)
           at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2028)
           at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2744)
           at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2723)
           at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2709)
           at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2696)
           at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2685)
           at my.app.MyView.open(MyView.java:33)
           ... 53 more
      Caused by: java.lang.ClassNotFoundException: my.app.Class
           at java.lang.Class.forName0(Native Method)
           at java.lang.Class.forName(Class.java:188)
           at sun.reflect.misc.ReflectUtil.forName(ReflectUtil.java:40)
           at com.sun.javafx.fxml.BeanAdapter.coerce(BeanAdapter.java:690)
           ... 71 more
      In the app the my.app.Class is to be instantiated with reflection by a component defined in fxml like:
      <MyView>
        ...
        <SplitPane orientation="VERTICAL" VBox.vgrow="ALWAYS" >
               ....
                   <someProperty>my.app.Class</someProperty>
               ....
         </SplitPane>
        ...
      </MyView>
      It can still be instantiated in the main method.
       class MyApp extends Application {
          ...
          public static void main(String[] args) {
              my.app.Class x = new my.app.Class(); // NP here
              launch();//fails
          }
      Any ideas?

      Best regards, Eugene.