Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8116059

ClassNotFoundException in coercion process in BeanAdapter with fully-qualified classname in FXML in deployed application

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 8
    • 7u6
    • javafx
    • None

      using jre7b19, when a fully-qualified classname is used as an attribute, there is an error in the coercion when deploying an application. For example:

      <StaticProvider providerClass="com.mycompany.base.MyClass"/>

      ...

      public class StaticProvider{
        private ObjectProperty<Class> providerClass = new SimpleObjectProperty();
        public ObjectProperty<Class> providerClassProperty(){return providerClass;}
        public Class getProviderClass() {return providerClassPropert().get();}
        public void setProviderClass(Class class1) { providerClassProperty().set(class1); }
      }

      (Pseudocode from memory)
      This example runs fine when starting in the IDE. JavaFX is able to coerce the string "com.mycompany.base.MyClass" to the MyClass.class object.

      After deploying the application however, when it is started via myapplication.jnlp, a ClassNotFoundException in the coercion process appears in the BeanAdapter. It seems that the wrong ClassLoader is set. When setting the ClassLoader of the FXMLLoader to a ClassLoader that must know the class, for example MyClass.class.getClassLoader, this error still appears.

            tbrandal Tomáš Brandalík (Inactive)
            srheinnecjfx Sebastian Rheinnecker (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: