Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » e(fx)clipse » e4 on JavaFX with maven/gradle and java8
e4 on JavaFX with maven/gradle and java8 [message #1808197] Wed, 19 June 2019 06:41 Go to next message
Ali Karimi is currently offline Ali KarimiFriend
Messages: 36
Registered: October 2015
Member
Hey,

i am just about to start a new application based on e4 on javaFX and i wanted to know if it is possible to develop an efxclipse application as a pure maven application or pure gradle application with java 8.

I found this repository doing all of this with java 11:

https://github.com/BestSolution-at/e4-efxclipse-maven-sample

I really like that approach. However i am unsure if all of this can also work with java 8 and i hope someone can tell me if i just would waste my time trying this out. I already tried the aforementioned example with java 8 but had no luck.

Thanks in advance.

[Updated on: Wed, 19 June 2019 07:15]

Report message to a moderator

Re: e4 on JavaFX with maven/gradle and java8 [message #1808307 is a reply to message #1808197] Fri, 21 June 2019 09:36 Go to previous messageGo to next message
Ali Karimi is currently offline Ali KarimiFriend
Messages: 36
Registered: October 2015
Member
Hey,

i was able to configure the mentioned project to work with java 8. Actually the problem was, that i had to locally build a needed dependency on maven-osgi-package-plugin.
I am able to start the application using the corresponding profiles and invoking a mvn clean install on the launch subproject.
Now a new problem arises when i try to add dependencies to one of the subprojects. I would like to add several org.apache.spark dependencies.
Unfortunately the compilation fails with the following error message:
[ERROR] Cannot resolve project dependencies:
[ERROR]   Software being installed: sample.mvn.app.product 1.0.0
[ERROR]   Missing requirement: sample.mvn.lib 0.0.1.201906210926 requires 'java.package; com.barchart.udt 0.0.0' but it could not be found
[ERROR]   Cannot satisfy dependency: sample.mvn.app.product 1.0.0 depends on: org.eclipse.equinox.p2.iu; sample.mvn.feature.feature.group 0.0.0
[ERROR]   Cannot satisfy dependency: sample.mvn.feature.feature.group 0.0.1.201906210926 depends on: org.eclipse.equinox.p2.iu; sample.mvn.lib [0.0.1.201906210926,0.0.1.201906210926]
[ERROR] 
[ERROR] See http://wiki.eclipse.org/Tycho/Dependency_Resolution_Troubleshooting for help.
[ERROR] TychoLifecycle prozess couldn't be started.
[INFO] 
[INFO] --- target-platform-configuration:1.2.0:target-platform (default-target-platform) @ sample.mvn.product ---
[INFO] 
[INFO] --- tycho-p2-publisher-plugin:1.2.0:publish-osgi-ee (default-publish-osgi-ee) @ sample.mvn.product ---
[INFO] Published profile IUs: [a.jre.javase 10.0.0, config.a.jre.javase 10.0.0]
[INFO] 
[INFO] --- tycho-p2-publisher-plugin:1.2.0:publish-products (default-publish-products) @ sample.mvn.product ---
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] 
[INFO] sample.mvn.parent .................................. SUCCESS [  0.155 s]
[INFO] sample.mvn.lib ..................................... SUCCESS [06:02 min]
[INFO] sample.mvn.app ..................................... SUCCESS [  1.050 s]
[INFO] sample.mvn.feature ................................. SUCCESS [  0.632 s]
[INFO] sample.mvn.product ................................. FAILURE [ 11.294 s]
[INFO] launch ............................................. SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 06:16 min
[INFO] Finished at: 2019-06-21T11:32:55+02:00
[INFO] Final Memory: 72M/1315M
[INFO] ------------------------------------------------------------------------


Any hint on this would be greatly appreciated.

I also forked the mentioned project and added my adjustments there. The dependencies i have added can be found in the pom.xml of the xxx.lib subproject.
The project can be found here:

https://github.com/oemergenc/e4-efxclipse-maven-sample/

Thanks in advance.
Re: e4 on JavaFX with maven/gradle and java8 [message #1808340 is a reply to message #1808307] Fri, 21 June 2019 16:52 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
You need to add those to the feature project as well
Re: e4 on JavaFX with maven/gradle and java8 [message #1808349 is a reply to message #1808340] Fri, 21 June 2019 19:28 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
I wonder what you had to compile locally because that should not be required.
Re: e4 on JavaFX with maven/gradle and java8 [message #1808358 is a reply to message #1808349] Fri, 21 June 2019 22:26 Go to previous messageGo to next message
Ali Karimi is currently offline Ali KarimiFriend
Messages: 36
Registered: October 2015
Member
Hey,

thanks for your help. Unfortunately adding the dependencies to the feature project results in a new error message:

[INFO] --- maven-osgi-package-plugin:0.0.2-SNAPSHOT:package-feature (default) @ sample.mvn.feature ---
[ERROR] List of artifacts which are no valid OSGI bundles: 
[ERROR] 	[org.projectlombok:lombok:1.18.8]
[ERROR] 	[org.apache.spark:spark-core_2.11:2.4.3]
[ERROR] 	[org.apache.spark:spark-streaming-kafka_2.11:1.6.3]
[ERROR] 	[org.apache.spark:spark-sql_2.11:2.4.3]
[ERROR] 	[org.apache.spark:spark-sql-kafka-0-10_2.11:2.4.3]
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] 
[INFO] sample.mvn.parent .................................. SUCCESS [  0.387 s]
[INFO] sample.mvn.lib ..................................... SUCCESS [05:53 min]
[INFO] sample.mvn.app ..................................... SUCCESS [  0.772 s]
[INFO] sample.mvn.feature ................................. FAILURE [  0.659 s]
[INFO] sample.mvn.product ................................. SKIPPED
[INFO] launch ............................................. SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 05:56 min
[INFO] Finished at: 2019-06-22T00:14:25+02:00
[INFO] Final Memory: 40M/1439M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal at.bestsolution:maven-osgi-package-plugin:0.0.2-SNAPSHOT:package-feature (default) on project sample.mvn.feature: Execution default of goal at.bestsolution:maven-osgi-package-plugin:0.0.2-SNAPSHOT:package-feature failed: There are dependencies which are no OSGI bundles. They can not be used in the product. Convert them to valid OSGI bundles. See the list of artifacts above. -> [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/PluginExecutionException
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <goals> -rf :sample.mvn.feature

Process finished with exit code 1


I added exactly the same dependencies to the feature product like to ones of the xxx.lib subproject.

Any further ideas?

Regarding the build i needed to do the following to get the build of this project to work:
git clone https://github.com/BestSolution-at/maven-osgi-plugin.git
cd maven-osgi-plugin
mvn clean install


Otherwise the build of the *e4-efxclipse-maven-sample* project did not complete successfully due to a missing dependency to maven-osgi-plugin.

[Updated on: Fri, 21 June 2019 22:27]

Report message to a moderator

Re: e4 on JavaFX with maven/gradle and java8 [message #1808391 is a reply to message #1808358] Sun, 23 June 2019 14:05 Go to previous messageGo to next message
Ali Karimi is currently offline Ali KarimiFriend
Messages: 36
Registered: October 2015
Member
Hey,

i think i have come a step closer to what i want. The problem here is, that these dependencies are not OSGI bundles.
Therefore i created a new subproject and modified the bnd.bnd file to include those dependencies as an OSGI bundle. For testing purposes i have added two dependencies,
one on org.osgeo.proj4j and one on a spark-core library. I am able to use classes from the proj4j library.
The code of that new subproject can be found here:

https://github.com/oemergenc/e4-efxclipse-maven-sample/blob/master/sample.mvn.parent/sample.mvn.spark/pom.xml

However whenever the spark-core library is included the application refuses to start with the following error message:

...
[INFO] --- maven-osgi-exec-plugin:0.0.2-SNAPSHOT:exec-osgi-java (default) @ launch ---
osgi> !SESSION 2019-06-23 15:57:01.145 -----------------------------------------------
eclipse.buildId=unknown
java.version=1.8.0_191
java.vendor=Oracle Corporation
BootLoader constants: OS=macosx, ARCH=x86_64, WS=cocoa, NL=de_US
Framework arguments:  -product sample.mvn.app.product -clearPersistedState
Command-line arguments:  -console -consoleLog -product sample.mvn.app.product -clearPersistedState -clean

!ENTRY org.eclipse.e4.ui.workbench 4 0 2019-06-23 15:57:02.925
!MESSAGE Unable to create class 'org.eclipse.fx.ui.workbench.fx.PartRenderingEngine' from bundle '73'
!STACK 0
org.eclipse.e4.core.di.InjectionException: Could not find satisfiable constructor in org.eclipse.fx.ui.workbench.fx.PartRenderingEngine
	at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:420)
	at org.eclipse.e4.core.internal.di.InjectorImpl.make(InjectorImpl.java:333)
	at org.eclipse.e4.core.contexts.ContextInjectionFactory.make(ContextInjectionFactory.java:193)
	at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.createFromBundle(ReflectionContributionFactory.java:108)
	at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.doCreate(ReflectionContributionFactory.java:77)
	at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.create(ReflectionContributionFactory.java:59)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.instantiateRenderer(E4Workbench.java:169)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:153)
	at org.eclipse.fx.ui.workbench.fx.E4Application$1.lambda$0(E4Application.java:241)
	at org.eclipse.fx.ui.controls.internal.FXThreadSynchronizeImpl.syncExec(FXThreadSynchronizeImpl.java:109)
	at org.eclipse.fx.ui.workbench.fx.E4Application$1.run(E4Application.java:232)
	at org.eclipse.fx.ui.workbench.fx.E4Application.jfxStart(E4Application.java:253)
	at org.eclipse.fx.ui.workbench.fx.DefaultJFXApp.start(DefaultJFXApp.java:57)
	at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$161(LauncherImpl.java:863)
	at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$174(PlatformImpl.java:326)
	at com.sun.javafx.application.PlatformImpl.lambda$null$172(PlatformImpl.java:295)
	at java.security.AccessController.doPrivileged(Native Method)
	at com.sun.javafx.application.PlatformImpl.lambda$runLater$173(PlatformImpl.java:294)
	at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
Jun 23, 2019 3:57:02 PM org.eclipse.fx.ui.workbench.base.internal.LoggerProviderImpl$1 error
INFORMATION: Failed to create the presentation engine for URI: bundleclass://org.eclipse.fx.ui.workbench.fx/org.eclipse.fx.ui.workbench.fx.PartRenderingEngine


From here i have no clue where or what to investigate. The problem maybe that spark has a lot of transitive dependencies, some of them were included by bnd others not.
However any hint on what/where i could further investigate would be nice.

Thanks in advance.

[Updated on: Sun, 23 June 2019 14:08]

Report message to a moderator

Re: e4 on JavaFX with maven/gradle and java8 [message #1808393 is a reply to message #1808391] Sun, 23 June 2019 18:45 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
If I had to guess I'd say eg the declarative services system did not start - I'll try to clone your project and have a look tomorrow
Re: e4 on JavaFX with maven/gradle and java8 [message #1808483 is a reply to message #1808393] Tue, 25 June 2019 14:00 Go to previous messageGo to next message
Ali Karimi is currently offline Ali KarimiFriend
Messages: 36
Registered: October 2015
Member
Hey,

any progress on this? Unfortunately i am clueless.

Cheers,
Re: e4 on JavaFX with maven/gradle and java8 [message #1808556 is a reply to message #1808483] Wed, 26 June 2019 19:24 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Well I took a look and the problem is caused by the fact that your spark stuff loads 2 bundles who conflict with those usd by efxclipse/e4. Unfortunately the launch code currently uses the maven resolver (who resolve transitive dependencies). So you need to exclude those in the launch/pom.xml

		<dependency>
			<groupId>sample.mvn</groupId>
			<artifactId>sample.mvn.feature</artifactId>
			<version>${project.version}</version>
			<exclusions>
            	<exclusion>
            		<groupId>javax.annotation</groupId>
    				<artifactId>javax.annotation-api</artifactId>
            	</exclusion>
            	<exclusion>
            		<groupId>org.glassfish.hk2.external</groupId>
    				<artifactId>javax.inject</artifactId>
            	</exclusion>
            </exclusions>
		</dependency>

Re: e4 on JavaFX with maven/gradle and java8 [message #1808558 is a reply to message #1808556] Wed, 26 June 2019 19:58 Go to previous messageGo to next message
Ali Karimi is currently offline Ali KarimiFriend
Messages: 36
Registered: October 2015
Member
Hey,

wow cool.
Can you tell me, how you debugged this so that i can do that myself next time?

Thanks in advance
Re: e4 on JavaFX with maven/gradle and java8 [message #1808559 is a reply to message #1808558] Wed, 26 June 2019 20:04 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
I did not really debugged that one because I had the immediate idea that this is the problem and then the only thing I did was to do ss javax in the interactive console :-)
Re: e4 on JavaFX with maven/gradle and java8 [message #1809011 is a reply to message #1808559] Fri, 05 July 2019 20:31 Go to previous messageGo to next message
Derek Vasconcelos is currently offline Derek VasconcelosFriend
Messages: 12
Registered: February 2014
Junior Member
is there any estimated date for these snapshot dependencies to become releases?

Thanks

[Updated on: Fri, 05 July 2019 20:31]

Report message to a moderator

Re: e4 on JavaFX with maven/gradle and java8 [message #1809202 is a reply to message #1809011] Thu, 11 July 2019 12:23 Go to previous message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
I'll release them in the next few weeks!
Previous Topic:Generate JavaFX Getters and Setters fails with exception
Next Topic:e(fx)clipse does not recognice javaFX SDK
Goto Forum:
  


Current Time: Fri Oct 04 18:20:03 GMT 2024

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

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

Back to the top