Has anyone tried using a custom Log Formatter with a JavaFX app, where the
log formatter was not part of the main application jar?

We have a class implementing java.util.logging.Formatter that is present in
a utility Jar.  That utility jar is specified on the classpath for our
JavaFX application using the javafxpackager -createjar command with
the -classpath option.  We can see that the jar is correctly added to the
JavaFX-Class-Path: entry in the jar's manifest.

However, the java.utils.logging APIs are not able to load it.

We then hacked the package.cfg file in the application bundle created by
javafxpacker -deploy -native  to add this jar on the app.classpath= line
 (which was otherwise left blank).

That fixed the problem.

Looking more closely at the javafx launcher source code
(fxpackager/src/main/java/com/javafx/Main.java) I see that a new
URLClassLoader is created but using 'null' as the parent ClassLoader
instead of the System ClassLoader or ContectClassLoader.

Is that intentional?

Note that this also broke other aspects of our application that dealt with
loading plugins.  I use the logging as an example because it is much
simpler.

Our application is compiled and deployed with 7u45.

Regards,

Scott

Reply via email to