Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » e(fx)clipse » Create JavaFX OSGi Application and package with tycho
Create JavaFX OSGi Application and package with tycho [message #1809204] Thu, 11 July 2019 13:13 Go to next message
Nicolas De Amicis is currently offline Nicolas De AmicisFriend
Messages: 19
Registered: February 2014
Junior Member
Hello, I have create a sample project "JavaFX OSGi Application" for evaluation. I have 4 projects:

  • test.app
  • test.app.feature
  • test.app.product
  • test.app.releng

After some modifications (due to outdated wizard, ...) I can run my sample on eclipse with the corresponding launcher.

Now I would like to build the sample with maven-tycho and create a "ready to use" bundle for linux.

I ran mvn clean package on the project test.app.releng, and I see the output jar files and the xml files (p2artifacts.xml and p2content.xml). After that I ran mvn clean package on the project test.app.product and I have this error:
[INFO] Scanning for projects...
[INFO] Computing target platform for MavenProject: ch.test:ch.test.app.product:1.0.0-SNAPSHOT @ /home/deamicisn/workspace/ch.test.app.product/pom.xml
[INFO] Fetching p2.index from http://download.eclipse.org/releases/2019-06/
[INFO] Adding repository http://download.eclipse.org/releases/2019-06
[INFO] Fetching p2.index from https://download.eclipse.org/technology/epp/packages/2019-06/
[INFO] Fetching p2.index from http://download.eclipse.org/releases/2019-06/201906191000/
[INFO] Fetching p2.index from http://download.eclipse.org/releases/2019-06/201906191000/
[INFO] Adding repository http://download.eclipse.org/efxclipse/runtime-nightly/site
[INFO] Adding repository http://downloads.efxclipse.org/efxclipse.bestsolution.at/p2-repos/addons/nightly/site
[INFO] Resolving dependencies of MavenProject: ch.test:ch.test.app.product:1.0.0-SNAPSHOT @ /home/deamicisn/workspace/ch.test.app.product/pom.xml
[INFO] {osgi.os=linux, osgi.ws=gtk, org.eclipse.update.install.features=true, osgi.arch=x86_64}
[ERROR] Cannot resolve project dependencies:
[ERROR]   Software being installed: ch.test.app.product 1.0.0
[ERROR]   Missing requirement: ch.test.app.product 1.0.0 requires 'org.eclipse.equinox.p2.iu; ch.test.app.feature.feature.group [1.0.0.SNAPSHOT,1.0.0.SNAPSHOT]' but it could not be found
[ERROR] 
[ERROR] See http://wiki.eclipse.org/Tycho/Dependency_Resolution_Troubleshooting for help.
[ERROR] Cannot resolve dependencies of MavenProject: ch.test:ch.novelis.test.app.product:1.0.0-SNAPSHOT @ /home/deamicisn/workspace/ch.test.app.product/pom.xml: See log for details -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MavenExecutionException


I specify some points:

  1. The project needs to run with java 8
  2. I'm a newbie in OSGi and equinox
  3. I read a lot of forums and docs on the subject, but I haven't found how to build an application or an example to run with native launcher or the documentation is partial or outdated


How to build with maven and run (outside eclipse) a sample program?
Re: Create JavaFX OSGi Application and package with tycho [message #1809445 is a reply to message #1809204] Tue, 16 July 2019 09:45 Go to previous messageGo to next message
Nicolas De Amicis is currently offline Nicolas De AmicisFriend
Messages: 19
Registered: February 2014
Junior Member
What is the right way to build JavaFX OSGi Application (efxclipse) with tycho? mvn clean package on:

  • root project (test.app)?
  • releng project (test.app.releng)?
  • other?

I'm happy to see I'm not the only one that have difficulties to found some documentation on that subject -> https://stackoverflow.com/questions/16325693/eclipse-4-rcp-aka-e4-documentation

Now I'm following this tuto https://github.com/jsievers/tycho-demo.git (EclipseCon 2014 Tycho Tutorial). I added a repository project but when I build the root project (test.app) I have missing dependencies on org.eclipse.equinox.p2.iu. I saw that it need to adding the feature org.eclipse.e4.rcp but it doesn't change anything.
Re: Create JavaFX OSGi Application and package with tycho [message #1809477 is a reply to message #1809445] Tue, 16 July 2019 17:45 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
I can take a look later this week if you push your minimal sample to github this would make it a lot easier for me. Well you also mention an e4 tutorial but you try to build a simple OSGi application so I wanted to make sure you know that this is not e4
Re: Create JavaFX OSGi Application and package with tycho [message #1809507 is a reply to message #1809477] Wed, 17 July 2019 07:21 Go to previous messageGo to next message
Nicolas De Amicis is currently offline Nicolas De AmicisFriend
Messages: 19
Registered: February 2014
Junior Member
Ok, I will push on github my sample. It's a hello world app.
I know that the tutorial is for e4, but I haven't found a tutorial on how build and distribute a JavaFX OSGi Application. I try to understand all parts for developing and distributing the application. It's not clear for me how can I build (with mvn-tycho) the app for executing on the end-user's computer.

When I run mvn clean package on test.app.releng with tycho 1.0.0 (default version) I have this missing requirement:
[ERROR] Cannot resolve project dependencies:
[ERROR]   Software being installed: test.app.feature.feature.group 1.0.0.qualifier
[ERROR]   Missing requirement: test.app.feature.feature.group 1.0.0.qualifier requires 'org.eclipse.fx.javafx 0.0.0' but it could not be found

When I run mvn clean package on test.app.releng with tycho 1.4.0 (last version) I have this another missing requirement:
[ERROR] Cannot resolve project dependencies:
[ERROR]   Software being installed: test.app.feature.feature.group 1.0.0.qualifier
[ERROR]   Missing requirement: test.app.feature.feature.group 1.0.0.qualifier requires 'org.eclipse.equinox.p2.iu; org.eclipse.fx.javafx 0.0.0' but it could not be found

I think the difference is that between 1.0.0 and 1.4.0, they are some changes like this
Re: Create JavaFX OSGi Application and package with tycho [message #1809513 is a reply to message #1809507] Wed, 17 July 2019 08:13 Go to previous messageGo to next message
Nicolas De Amicis is currently offline Nicolas De AmicisFriend
Messages: 19
Registered: February 2014
Junior Member
Please found here the minimal sample : https://github.com/deamn/test-app.git
Thanks
Re: Create JavaFX OSGi Application and package with tycho [message #1809565 is a reply to message #1809513] Thu, 18 July 2019 09:49 Go to previous messageGo to next message
Nicolas De Amicis is currently offline Nicolas De AmicisFriend
Messages: 19
Registered: February 2014
Junior Member
I found the problem:

  1. changed tycho version to 1.4.0 (instead 1.0.0) in pom.xml from the test.app.releng project
  2. removed org.eclipse.fx.javafx in feature.xml from the test.app.feature project

Now I can build the zip for deployment.
I have another questions now:

  • could I update existing program (deployed before with a zip archive) with P2 repo? or I need to build e4 JavaFX app for this feature?
  • could I update and make a pull request to efxclipse project to update those outdated wizards?

Re: Create JavaFX OSGi Application and package with tycho [message #1809688 is a reply to message #1809565] Sat, 20 July 2019 10:05 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
On your questions:
* you can use p2 without e4 - there's an UpdateService API and p2 impl in our core projects
* of course we happily accept contributions for the IDE it is https://github.com/eclipse-efx/efxclipse-eclipse
Re: Create JavaFX OSGi Application and package with tycho [message #1809842 is a reply to message #1809688] Wed, 24 July 2019 14:18 Go to previous messageGo to next message
Nicolas De Amicis is currently offline Nicolas De AmicisFriend
Messages: 19
Registered: February 2014
Junior Member
Quote:
you can use p2 without e4 - there's an UpdateService API and p2 impl in our core projects

Where can I configured the p2 update site url? In the .product file (Updates part)? or with a p2.inf file? Where I could put this p2.inf file? with .product file? in META-INF folder?
I use UpdateService (org.eclipse.fx.core.update.UpdateService) and on startup I have this error (outside Eclipse IDE):
Update failed: Check for update failed unexpectedly
org.eclipse.fx.core.StatusException
	at org.eclipse.fx.core.p2.UpdateServiceImpl$1.run(UpdateServiceImpl.java:200)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
java.lang.NullPointerException
	at org.eclipse.equinox.internal.p2.repository.helpers.AbstractRepositoryManager.handleRemoteIndexFile(AbstractRepositoryManager.java:713)
	at org.eclipse.equinox.internal.p2.repository.helpers.AbstractRepositoryManager.loadIndexFile(AbstractRepositoryManager.java:707)
	at org.eclipse.equinox.internal.p2.repository.helpers.AbstractRepositoryManager.loadRepository(AbstractRepositoryManager.java:649)
	at org.eclipse.equinox.internal.p2.metadata.repository.MetadataRepositoryManager.loadRepository(MetadataRepositoryManager.java:110)
	at org.eclipse.equinox.internal.p2.metadata.repository.MetadataRepositoryManager.loadRepository(MetadataRepositoryManager.java:105)
	at org.eclipse.equinox.p2.engine.ProvisioningContext.loadMetadataRepository(ProvisioningContext.java:238)
	at org.eclipse.equinox.p2.engine.ProvisioningContext.getLoadedMetadataRepositories(ProvisioningContext.java:216)
	at org.eclipse.equinox.p2.engine.ProvisioningContext.getMetadata(ProvisioningContext.java:304)
	at org.eclipse.equinox.internal.p2.director.SimplePlanner.updatesFor(SimplePlanner.java:1003)
	at org.eclipse.equinox.p2.operations.UpdateOperation.updatesFor(UpdateOperation.java:144)
	at org.eclipse.equinox.p2.operations.UpdateOperation.computeProfileChangeRequest(UpdateOperation.java:179)
	at org.eclipse.equinox.p2.operations.UpdateOperation.lambda$0(UpdateOperation.java:314)
	at org.eclipse.equinox.internal.p2.operations.SearchForUpdatesResolutionJob.runModal(SearchForUpdatesResolutionJob.java:41)
	at org.eclipse.equinox.p2.operations.ProfileChangeOperation.resolveModal(ProfileChangeOperation.java:118)
	at org.eclipse.fx.core.p2.UpdateServiceImpl$1.run(UpdateServiceImpl.java:182)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)

If I run with my eclipse IDE, I have an another error:
org.eclipse.fx.core.StatusException
	at org.eclipse.fx.core.p2.UpdateServiceImpl$1.run(UpdateServiceImpl.java:192)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
Update failed: No provisioning job available

Currently the update site isn't configured, but I have no entry in access_log from my apache server...
Re: Create JavaFX OSGi Application and package with tycho [message #1809845 is a reply to message #1809842] Wed, 24 July 2019 14:36 Go to previous messageGo to next message
Nicolas De Amicis is currently offline Nicolas De AmicisFriend
Messages: 19
Registered: February 2014
Junior Member
If I try with a local folder (configured in .product file), it's works (no update available, it's that expected) but if I put an url like http://myserver/repository I have always the same error mentioned above.
I read in that forum (posted in 2015 by you) it's mentioned that org.eclipse.core.net and org.eclipse.equinox.security need to be included into dependencies. What I made but no change for me...
Re: Create JavaFX OSGi Application and package with tycho [message #1809849 is a reply to message #1809845] Wed, 24 July 2019 19:04 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
I think you need to increase the product version to get an update info - and you need run in the exported version - self hosting does not work for p2.
Re: Create JavaFX OSGi Application and package with tycho [message #1809884 is a reply to message #1809849] Thu, 25 July 2019 09:45 Go to previous messageGo to next message
Nicolas De Amicis is currently offline Nicolas De AmicisFriend
Messages: 19
Registered: February 2014
Junior Member
I know that I need to increase the product version to get an update info, but currently I would "connect" my app to a web repo and not locally.
I wrote that if I configure a local folder (/xxx/test.app.product/target/repository) I have the message like "no update available": it seems that the update process connect to the local repo.
But If I copy this folder on a web server I have the message "Check for update failed unexpectedly". I think they are missing dependencies?
Re: Create JavaFX OSGi Application and package with tycho [message #1809890 is a reply to message #1809884] Thu, 25 July 2019 10:49 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
In e4 world we include various p2 features

Tom
Re: Create JavaFX OSGi Application and package with tycho [message #1809906 is a reply to message #1809890] Thu, 25 July 2019 13:57 Go to previous messageGo to next message
Nicolas De Amicis is currently offline Nicolas De AmicisFriend
Messages: 19
Registered: February 2014
Junior Member
Thanks to taking time to respond but you said that for updating my application with a p2 update site (apache), I must develop my JavaFX application as "JavaFX e4 Application"?
You had mentioned the inverse in this post:
Thomas Schindl wrote on Sat, 20 July 2019 06:05
you can use p2 without e4 - there's an UpdateService API and p2 impl in our core projects

What is the right way?

I think they are missing dependencies or missing configurations. My p2 update site is never contacted by the application (no entries in apache access_log) and I have this error (already posted):
Update failed: Check for update failed unexpectedly
org.eclipse.fx.core.StatusException
	at org.eclipse.fx.core.p2.UpdateServiceImpl$1.run(UpdateServiceImpl.java:200)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
java.lang.NullPointerException
	at org.eclipse.equinox.internal.p2.repository.helpers.AbstractRepositoryManager.handleRemoteIndexFile(AbstractRepositoryManager.java:713)
	at org.eclipse.equinox.internal.p2.repository.helpers.AbstractRepositoryManager.loadIndexFile(AbstractRepositoryManager.java:707)
	at org.eclipse.equinox.internal.p2.repository.helpers.AbstractRepositoryManager.loadRepository(AbstractRepositoryManager.java:649)
	at org.eclipse.equinox.internal.p2.metadata.repository.MetadataRepositoryManager.loadRepository(MetadataRepositoryManager.java:110)
	at org.eclipse.equinox.internal.p2.metadata.repository.MetadataRepositoryManager.loadRepository(MetadataRepositoryManager.java:105)
	at org.eclipse.equinox.p2.engine.ProvisioningContext.loadMetadataRepository(ProvisioningContext.java:238)
	at org.eclipse.equinox.p2.engine.ProvisioningContext.getLoadedMetadataRepositories(ProvisioningContext.java:216)
	at org.eclipse.equinox.p2.engine.ProvisioningContext.getMetadata(ProvisioningContext.java:304)
	at org.eclipse.equinox.internal.p2.director.SimplePlanner.updatesFor(SimplePlanner.java:1003)
	at org.eclipse.equinox.p2.operations.UpdateOperation.updatesFor(UpdateOperation.java:144)
	at org.eclipse.equinox.p2.operations.UpdateOperation.computeProfileChangeRequest(UpdateOperation.java:179)
	at org.eclipse.equinox.p2.operations.UpdateOperation.lambda$0(UpdateOperation.java:314)
	at org.eclipse.equinox.internal.p2.operations.SearchForUpdatesResolutionJob.runModal(SearchForUpdatesResolutionJob.java:41)
	at org.eclipse.equinox.p2.operations.ProfileChangeOperation.resolveModal(ProfileChangeOperation.java:118)
	at org.eclipse.fx.core.p2.UpdateServiceImpl$1.run(UpdateServiceImpl.java:182)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)

I use org.eclipse.equinox.p2.repository_2.4.400.v20190318-1320.jar. See the line 713 in the snippet of AbstractRepositoryManager.java:
710: private LocationProperties handleRemoteIndexFile(URI indexFileURI, IProgressMonitor monitor) {
711: 	ByteArrayOutputStream index = new ByteArrayOutputStream();
712: 	IStatus indexFileStatus = null;
713: 	indexFileStatus = getTransport().download(indexFileURI, index, monitor);
714: 	if (indexFileStatus != null && indexFileStatus.isOK())
715: 		return LocationProperties.create(new ByteArrayInputStream(index.toByteArray()));
716: 	return LocationProperties.createEmptyIndexFile();
717: }

There is a NullPointerException on this line. Here the snippet of the method getTransport where I think something goes wrong (agent is null?):
protected Transport getTransport() {
	return (Transport) agent.getService(Transport.SERVICE_NAME);
}
Re: Create JavaFX OSGi Application and package with tycho [message #1809936 is a reply to message #1809906] Thu, 25 July 2019 20:40 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
No that's not what I meant I only wanted to say that in e4 we use a special feature who contains all required bundles - and you could use that for inspiration
Re: Create JavaFX OSGi Application and package with tycho [message #1809950 is a reply to message #1809936] Fri, 26 July 2019 08:19 Go to previous messageGo to next message
Nicolas De Amicis is currently offline Nicolas De AmicisFriend
Messages: 19
Registered: February 2014
Junior Member
Thanks for the answer. The feature needed is org.eclipse.equinox.server.p2
Re: Create JavaFX OSGi Application and package with tycho [message #1809960 is a reply to message #1809950] Fri, 26 July 2019 13:29 Go to previous messageGo to next message
Nicolas De Amicis is currently offline Nicolas De AmicisFriend
Messages: 19
Registered: February 2014
Junior Member
Now I'm testing the update process itself and (surprise) I have another error... I have increased the product version and rebuilt with maven and updated the repo with latest version.
When I run the (outdated) test program, I have this error:
Update failed: Operation details
org.eclipse.fx.core.StatusException
	at org.eclipse.fx.core.p2.UpdateServiceImpl$1.run(UpdateServiceImpl.java:196)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)

Do you have a list to minimal features to include for updating process? I have added these features:

  • org.eclipse.equinox.p2.core.feature
  • org.eclipse.equinox.p2.discovery.feature
  • org.eclipse.equinox.p2.extras.feature
  • org.eclipse.equinox.p2.rcp.feature
  • org.eclipse.equinox.server.p2
  • org.eclipse.fx.core.feature

Do you have an idea?
Re: Create JavaFX OSGi Application and package with tycho [message #1810025 is a reply to message #1809960] Mon, 29 July 2019 12:41 Go to previous messageGo to next message
Nicolas De Amicis is currently offline Nicolas De AmicisFriend
Messages: 19
Registered: February 2014
Junior Member
Now, the update works well. I must include these features for that:

  • org.eclipse.equinox.p2.core.feature
  • org.eclipse.equinox.server.core
  • org.eclipse.equinox.server.p2
  • org.eclipse.fx.core.feature

With JavaFX OSGi Application, after update, can I use RestartService for restarting the application ? I found a lot of samples but with e4 environment. Or I need to restart manually the application?
When I try to inject RestartService, I have this error:
org.eclipse.e4.core.di.injectionexception: unable to process "UpdateService": no actual value was found for the argument
Re: Create JavaFX OSGi Application and package with tycho [message #1810027 is a reply to message #1810025] Mon, 29 July 2019 14:10 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
RestartService is only available in e4 world or at least we only have an impl available there - you might want to file a ticket and provide an implementation for OSGi only apps
Re: Create JavaFX OSGi Application and package with tycho [message #1810445 is a reply to message #1810027] Mon, 12 August 2019 07:17 Go to previous messageGo to next message
Nicolas De Amicis is currently offline Nicolas De AmicisFriend
Messages: 19
Registered: February 2014
Junior Member
Last question, after that I will start the development of a JavaFX OSGi Application with Java 11 for production usage: the EventBus is 100% usable in "JavaFX OSGi World" or I need e4 librairies too?
Re: Create JavaFX OSGi Application and package with tycho [message #1810588 is a reply to message #1810445] Tue, 13 August 2019 22:24 Go to previous message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Well you talk about the "org.eclipse.fx.core.event.EventBus"? Yes but you need to use the "GlobalEventBus" subtype in a pure OSGi-Env because only that one is registered in the OSGi-Service-Registry
Previous Topic:e(fx)clipse does not recognice javaFX SDK
Next Topic:XML file is created on Windows desktop
Goto Forum:
  


Current Time: Thu Dec 26 20:26:30 GMT 2024

Powered by FUDForum. Page generated in 0.04667 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top