e4 on JavaFX with maven/gradle and java8 [message #1808197] |
Wed, 19 June 2019 06:41  |
Eclipse User |
|
|
|
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] by Moderator 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   |
Eclipse User |
|
|
|
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 #1808358 is a reply to message #1808349] |
Fri, 21 June 2019 22:26   |
Eclipse User |
|
|
|
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] by Moderator 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   |
Eclipse User |
|
|
|
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] by Moderator Report message to a moderator
|
|
|
|
|
Re: e4 on JavaFX with maven/gradle and java8 [message #1808556 is a reply to message #1808483] |
Wed, 26 June 2019 19:24   |
Eclipse User |
|
|
|
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>
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04983 seconds