title: Can't import custom components with custom cell factories
body: <p>In JavaFX 2.2 I've been having trouble importing custom components that have a custom cell factory defined in the FXML. Lets say my custom component is the following</p>
  
  <pre><code>public class CustomComponent extends VBox{
  
  public CustomComponent() {
      try {
          FXMLLoader loader = new FXMLLoader(getClass().getResource("CustomComponent.fxml"));
          loader.setRoot(this);
          loader.setController(this);
          loader.load();
      } catch (IOException e ){
          throw new RuntimeException(e);
      }
  }
  </code></pre>
  
  <p>}</p>
  
  <p>And the corresponding FXML is</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  
  &lt;?import javafx.scene.control.*?&gt;
  &lt;?import java.lang.*?&gt;
  &lt;?import javafx.scene.layout.*?&gt;
  &lt;?import javafx.scene.layout.VBox?&gt;
  &lt;?import application.*?&gt;
  &lt;?import application.TestFactory?&gt;
  
  
  &lt;fx:root prefHeight="358.0" prefWidth="260.0" type="VBox" xmlns:fx="http://javafx.com/fxml/1" xmlns="http://javafx.com/javafx/8"&gt;
     &lt;children&gt;
        &lt;TableView prefHeight="200.0" prefWidth="200.0" VBox.vgrow="ALWAYS"&gt;
          &lt;columns&gt;
            &lt;TableColumn prefWidth="75.0" text="C1" &gt;
              &lt;cellFactory&gt;
                  &lt;TestFactory /&gt;
              &lt;/cellFactory&gt;
            &lt;/TableColumn&gt;
            &lt;TableColumn prefWidth="75.0" text="C2" &gt;
            &lt;cellFactory&gt;
              &lt;TestFactory /&gt;
            &lt;/cellFactory&gt;
            &lt;/TableColumn&gt;
          &lt;/columns&gt;
           &lt;columnResizePolicy&gt;
              &lt;TableView fx:constant="CONSTRAINED_RESIZE_POLICY" /&gt;
           &lt;/columnResizePolicy&gt;
        &lt;/TableView&gt;
     &lt;/children&gt;
  &lt;/fx:root&gt;
  </code></pre>
  
  <p>and TestFactory is defined as </p>
  
  <pre><code>public class TestFactory&lt;S,T&gt; implements Callback&lt;TableColumn&lt;S, T&gt;, TableCell&lt;S, T&gt;&gt;{
  
      @Override
      public TableCell&lt;S, T&gt; call(TableColumn&lt;S, T&gt; param) {
          return new TableCell&lt;S,T&gt;();
      }
  
  }
  </code></pre>
  
  <p>And all three of these files are in the same directory / src package.</p>
  
  <p>When I jar these files together and try to import the jar into scenebuilder it will not find CustomComponent. However, if I take out the reference to the cellFactory &amp; TestFactory it will import just fine. Looking at the jar analysis it seems to throw a ClassNotFoundException on TestFactory.</p>
  
  <pre><code>Not a Node: application/Main.class
  
  Not a Node: application/TestFactory.class
  
  Exception for: application/CustomComponent.class
  javafx.fxml.LoadException: 
  unknown path:2
  
      at javafx.fxml.FXMLLoader.constructLoadException(FXMLLoader.java:2617)
      at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2595)
      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.runDiscovery(LibraryFolderWatcher.java:122)
      at com.oracle.javafx.scenebuilder.kit.library.user.LibraryFolderWatcher.run(LibraryFolderWatcher.java:88)
      at java.lang.Thread.run(Thread.java:744)
  Caused by: java.lang.RuntimeException: javafx.fxml.LoadException: 
  file:/C:/Users/bthomas/AppData/Roaming/Scene%20Builder/Library/testing.jar!/application/CustomComponent.fxml
  
      at application.CustomComponent.&lt;init&gt;(CustomComponent.java:17)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
      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)
      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)
      ... 8 more
  Caused by: javafx.fxml.LoadException: 
  file:/C:/Users/bthomas/AppData/Roaming/Scene%20Builder/Library/testing.jar!/application/CustomComponent.fxml
  
      at javafx.fxml.FXMLLoader.constructLoadException(FXMLLoader.java:2617)
      at javafx.fxml.FXMLLoader.importClass(FXMLLoader.java:2864)
      at javafx.fxml.FXMLLoader.processImport(FXMLLoader.java:2708)
      at javafx.fxml.FXMLLoader.processProcessingInstruction(FXMLLoader.java:2677)
      at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2517)
      at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2441)
      at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2409)
      at application.CustomComponent.&lt;init&gt;(CustomComponent.java:15)
      ... 18 more
  Caused by: java.lang.ClassNotFoundException: application.TestFactory
      at java.net.URLClassLoader$1.run(URLClassLoader.java:372)
      at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(URLClassLoader.java:360)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
      at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
      at javafx.fxml.FXMLLoader.loadTypeForPackage(FXMLLoader.java:2932)
      at javafx.fxml.FXMLLoader.loadType(FXMLLoader.java:2921)
      at javafx.fxml.FXMLLoader.importClass(FXMLLoader.java:2862)
      ... 24 more
  </code></pre>
  
  <p>I assume this is some classpath issue with scene builder, but i'm at a loss. Has anyone encountered this problem before or know of a solution?</p>