Using FXMLLoaderFactory to load an FXML with a controller in a different bundle [message #1706846] |
Mon, 31 August 2015 09:06  |
Eclipse User |
|
|
|
Hi,
I am writing a utility that uses FXMLLoaderFactory to load an FXML and use dependency injection with the controller. (The reason behind this is that the FXML is loaded from a server and is not located inside the bundle.)
The issue that I am facing is:
javafx.fxml.LoadException:
at javafx.fxml.FXMLLoader.constructLoadException(FXMLLoader.java:2605)
at javafx.fxml.FXMLLoader.access$700(FXMLLoader.java:104)
at javafx.fxml.FXMLLoader$ValueElement.processAttribute(FXMLLoader.java:918)
at javafx.fxml.FXMLLoader$InstanceDeclarationElement.processAttribute(FXMLLoader.java:967)
at javafx.fxml.FXMLLoader$Element.processStartElement(FXMLLoader.java:216)
at javafx.fxml.FXMLLoader$ValueElement.processStartElement(FXMLLoader.java:740)
at javafx.fxml.FXMLLoader.processStartElement(FXMLLoader.java:2711)
at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2531)
at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2429)
at org.eclipse.fx.osgi.util.OSGiFXMLLoader.loadWithController(OSGiFXMLLoader.java:440)
...
Caused by: java.lang.ClassNotFoundException: de.emsw.gosa.product.ega.controller.DokumenteController cannot be found by de.emsw.gosa.fx.util_1.0.0.qualifier
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:439)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:352)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:344)
at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:160)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at javafx.fxml.FXMLLoader$ValueElement.processAttribute(FXMLLoader.java:916)
... 132 more
The reason is that the controller class is not in the same bundle with the utility class. Is it possible to set the class loader for FXMLLoaderFactory, so that it searches in a bundle that I can specify?
Thanks!
Christoph
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.06136 seconds