Using JRebirth in several JARs - executable JAR fails

29 views
Skip to first unread message

Andreas

unread,
Aug 11, 2016, 4:55:06 AM8/11/16
to JRebirth Users
Hi Seb,

we implement a base project and use it as dependency for customer projects.

In the base JAR lots of views (FXML, Model, Controller, etc.) implemented. We reuse or extend the base implementations in custom projects.

The base project can run as an application too - as kind of bas/reference implementation.

If we build it with maven we get a executable jar, which can be started by double click and all is working fine.

The custom project executable Jar fails, because it cannot load for instance the Shell.fxml, which lies in the base Jar. So we get a null pointer exception like this:

2016-08-11 10:40:15,278 ERROR [JRebirthThreadPoolExecutor] - <jrebirth.concurrent.jtpError>
org.jrebirth.af.api.exception.CoreRuntimeException: <jrebirth.ui.fxml.fxmlNodeDoesntExist> values: nms/modules/shell/Shell.fxml|
 at org.jrebirth.af.core.ui.fxml.FXMLUtils.loadFXML(FXMLUtils.java:128)
 at org.jrebirth.af.core.ui.fxml.AbstractFXMLObjectModel.prepareView(AbstractFXMLObjectModel.java:111)
 at org.jrebirth.af.core.concurrent.JRebirth.run(JRebirth.java:68)
 at org.jrebirth.af.core.ui.AbstractBaseModel.ready(AbstractBaseModel.java:74)
 at org.jrebirth.af.core.component.basic.AbstractComponent.setup(AbstractComponent.java:509)
 at org.jrebirth.af.core.facade.AbstractFacade.retrieve(AbstractFacade.java:216)
 at org.jrebirth.af.core.command.basic.showmodel.PrepareModelCommand.perform(PrepareModelCommand.java:56)
 at org.jrebirth.af.core.command.AbstractBaseCommand.innerRun(AbstractBaseCommand.java:185)
 at org.jrebirth.af.core.command.CommandRunnable.runInto(CommandRunnable.java:67)
 at org.jrebirth.af.core.concurrent.AbstractJrbRunnable.run(AbstractJrbRunnable.java:80)
 at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
 at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
 at java.lang.Thread.run(Unknown Source)

Seams, the FXMLUtils.loadFXML cannot find or have access to the path of Shell.fxml file of the external JAR.

Do you have any idea, what I can do to solve this problem? Do you have any experience using JRebirth in several JARs?

Thanks a lot in advance

Kind regards
Andreas


Sebastien Bordes

unread,
Aug 11, 2016, 5:25:28 AM8/11/16
to jrebirth-users
Hi Andreas,

Does the base jar been added to the classpath ?

As a workaround you can temporary duplicate the fxml file into the customer jar (with same relative path).

Are you able to build a tiny project with 2 jars to reproduce the trouble ?

I will have a look tonight.

Seb

--
Vous recevez ce message, car vous êtes abonné au groupe Google Groupes "JRebirth Users".
Pour vous désabonner de ce groupe et ne plus recevoir d'e-mails le concernant, envoyez un e-mail à l'adresse jrebirth-users+unsubscribe@googlegroups.com.
Pour obtenir davantage d'options, consultez la page https://groups.google.com/d/optout.



--

Andreas

unread,
Aug 11, 2016, 6:09:30 AM8/11/16
to JRebirth Users
Hi Seb,

yes, the base jar is in the class path. Because the preloader screen and so on is logic of base jar (Application class).

We create with ANT a exe installer wich installes the application in following structure:

app/libs
   base.jar
app
   executable-app.jar
   App.cfg
runtime
App.exe

the installed custom application is working fine (started by an Exe file).

In the manifest of executable jar, the base.jar is listed.

I don't know, what the "App.exe" is doing different. The App.exe has a config file named App.cfg. Inside also the class path is defined too.

But the executable jar directly started isn't working.

regards
Andreas
Pour vous désabonner de ce groupe et ne plus recevoir d'e-mails le concernant, envoyez un e-mail à l'adresse jrebirth-user...@googlegroups.com.

Pour obtenir davantage d'options, consultez la page https://groups.google.com/d/optout.

Sebastien Bordes

unread,
Aug 11, 2016, 8:27:03 AM8/11/16
to jrebirth-users
I'm a little bit confused:

When running base_jar, it works without customization ?
When running executable-jar, does it work ?
When running App.exe, it crashes ?

How do you generate the exe file ? with ant command from javafx distribution ?
I don't know how it works, does the exe file has the same size as executable jar ?

Personnaly, I'using launch4j tightly integrated into maven build to generate the exe file and it only bootstraps the executable  jar (it's just a starter exe), Check the showcase demo application and its pom file :https://github.com/JRebirth/JRebirth/tree/8.x-dev/org.jrebirth.af/showcase/demo

This demo also demonstrates how to use JRebirth Modularization which can definitely help you.
You can create Interface Components that can be implemented into another library. (inspired by eclipse extension point but I still have to improve the priority management between all impl)
You can bowse ModuleModel, FXMLShowCaseModel to see an example that works (you will have to use custom processor library to generate metadata used by java service API during maven build (or gradle since bugs corrections recently made by asafalima))

Let me know if modularization can suit your needs and if using launch4j solves your exe trouble

Seb

Pour vous désabonner de ce groupe et ne plus recevoir d'e-mails le concernant, envoyez un e-mail à l'adresse jrebirth-users+unsubscribe@googlegroups.com.

Pour obtenir davantage d'options, consultez la page https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages