Repository navigation
equinoxLaunch problem with Eclipse 4.8 Targetplatform #69
Description
Activity
in the folder
build\headlessAppSetup\plugins
i find those jars:autosar-jaxbobjs.jar_0.0.0.jar castle.extdata.autosar.v4_1.0.0.qualifier.jar castle.extdata.dbc_1.0.0.qualifier.jar castle.extdata.fibex.v3_1_0_1.0.0.qualifier.jar castle.extdata.ldf_1.0.0.qualifier.jar castle.extdata.odx_220_1.0.0.qualifier.jar castle.extlib.antlr.runtime_4.5.3.jar castle.extlib.log4j-1.2.17_1.0.0.jar castle.testenv.com_1.0.0.qualifier.jar castle.testenv.sysgen_1.0.0.qualifier.jar castle.util_1.0.0.qualifier.jar com.sun.jna.platform_4.4.0.jar com.sun.jna_4.4.0.jar fibex-jaxbobjs.jar_0.0.0.jar icmp4j-all.jar_0.0.0.jar javax.inject_1.0.0.v20091030.jar javax.validation_1.1.0.v201304101302.jar javax.xml.bind_2.2.12.v201410011542.jar javax.xml_1.3.4.v201005080400.jar odx220-jaxbobjs.jar_0.0.0.jar org.apache.commons.lang3_3.1.0.v201403281430.jar org.apache.felix.scr_2.0.14.v20180117-1452.jar org.eclipse.core.contenttype_3.7.0.v20180426-1644.jar org.eclipse.core.jobs_3.10.0.v20180427-1454.jar org.eclipse.core.runtime_3.14.0.v20180417-0825.jar org.eclipse.equinox.app_1.3.500.v20171221-2204.jar org.eclipse.equinox.common_3.10.0.v20180412-1130.jar org.eclipse.equinox.ds_1.5.100.v20171221-2204.jar org.eclipse.equinox.preferences_3.7.100.v20180510-1129.jar org.eclipse.equinox.registry_3.8.0.v20180426-1327.jar org.eclipse.equinox.util_1.1.0.v20180419-0833.jar org.eclipse.jdt.annotation_2.2.0.v20180417-0931.jar org.eclipse.osgi.compatibility.state_1.1.100.v20180331-1743.jar org.eclipse.osgi.services_3.7.0.v20180223-1712.jar org.eclipse.osgi.util_3.5.0.v20180219-1511.jar org.eclipse.osgi_3.13.0.v20180409-1500.jar org.eclipse.persistence.antlr_3.5.2.v201711011707.jar org.eclipse.persistence.asm_6.1.1.v201804051226.jar org.eclipse.persistence.core_2.7.2.v20180622-f627448.jar org.eclipse.persistence.jpa.jpql_2.7.2.v20180622-f627448.jar org.eclipse.persistence.moxy_2.7.2.v20180622-f627448.jar org.eclipse.update.configurator_3.4.0.v20180512-1141.jar sysgen-c4config.jar_0.0.0.jar sysgen-jaxbethernetobjs.jar_0.0.0.jarImport-Package: org.osgi.service.component; version="1.3.0" is contained in org.eclipse.osgi.services_3.7.0.v20180223-1712.jar
So to me it seems all required bundles copied in place.
The same application with these bundles works when started from inside Eclipse.Is the issue perhaps related to runlevels? These are the defaults:
goomph/src/main/java/com/diffplug/gradle/eclipserunner/EquinoxLauncher.java
Lines 219 to 229 in 5de48d5
// enable map.put("equinox.use.ds", "true"); map.put(EclipseStarter.PROP_BUNDLES, Joiner.on(", ").join( // automatic bundle discovery and installation "org.eclipse.equinox.common@2:start", "org.eclipse.update.configurator@3:start", // support eclipse's -application argument "org.eclipse.core.runtime@4:start", // declarative services "org.eclipse.equinox.ds@5:start")); map.put(EclipseStarter.PROP_FRAMEWORK, getPluginRequireSingle("org.eclipse.osgi").toURI().toString()); These defaults haven't changed, but if you've upgraded your eclipse dependencies, perhaps the newer version of eclipse requires a different set of startlevels?
How can i overwrite those "osgi.bundles" from within the build.gradle. I cannot figure out the syntax.
Can you please help?I think the easiest way is to set system properties for the launched Equinox, but there wasn't a way to do this in 3.15. I just added this ability in 3.16.0-SNAPSHOT, which allows you to do this:
task runWithEquinox(type: EquinoxLaunchTask) { vmArgs = ['-Dosgi.bundles=org.eclipse.equinox.common@2:start,org.eclipse.update.configurator@3:start'] }
Since your eclipse launch works, I would try to tinker with the runlevels there first, to make sure that you can reproduce and fix the problem there. That can confirm that the problem is runlevel-related.
Thanks for the addition.
Unfortunately i don't get how to apply your snippet on my existing equinoxLaunch:equinoxLaunch { // creates an EquinoxLaunchSetupTask named 'headlessAppSetup' headlessAppSetup { source.addProject(project(':castle.testenv.sysgen')) // creates an EquinoxLaunchTask named 'headlessApp' which depends on 'headlessAppSetup' launchTask 'sysgenApp', { it.args = ['-consoleLog', '-application', 'castle.testenv.sysgen.application'] it.workingDir = file(sysgenWorkdir) } } }In the working eclipse launch directory, i found the information:
With startlevel param:org.eclipse.equinox.common_3.10.0.v20180412-1130.jar@2\:start org.eclipse.core.runtime_3.14.0.v20180417-0825.jar@startand the osgi.bundles.defaultStartLevel=4
Gradle gives me:
> Could not find com.diffplug.gradle:goomph:3.16.0-SNAPSHOT. Searched in the following locations: https://jcenter.bintray.com/com/diffplug/gradle/goomph/3.16.0-SNAPSHOT/maven-metadata.xml https://jcenter.bintray.com/com/diffplug/gradle/goomph/3.16.0-SNAPSHOT/goomph-3.16.0-SNAPSHOT.pom https://jcenter.bintray.com/com/diffplug/gradle/goomph/3.16.0-SNAPSHOT/goomph-3.16.0-SNAPSHOT.jar https://plugins.gradle.org/m2/com/diffplug/gradle/goomph/3.16.0-SNAPSHOT/maven-metadata.xml https://plugins.gradle.org/m2/com/diffplug/gradle/goomph/3.16.0-SNAPSHOT/goomph-3.16.0-SNAPSHOT.pom https://plugins.gradle.org/m2/com/diffplug/gradle/goomph/3.16.0-SNAPSHOT/goomph-3.16.0-SNAPSHOT.jarbuildscript { repositories { maven { url "https://oss.sonatype.org/content/repositories/snapshots" } } } equinoxLaunch { headlessAppSetup { source.addProject(project(':castle.testenv.sysgen')) // creates an EquinoxLaunchTask named 'headlessApp' which depends on 'headlessAppSetup' launchTask 'sysgenApp', { it.args = ['-consoleLog', '-application', 'castle.testenv.sysgen.application'] it.workingDir = file(sysgenWorkdir) it.vmArgs = ['-Dosgi.bundles=org.eclipse.equinox.common@2:start,org.eclipse.core.runtime@start'] } } } }
Changing this in build.gradle did no change in the error output.
When I add
-Dosgi.bundles=org.eclipse.equinox.common@2:start,org.eclipse.core.runtime@startto the VM args in the Eclipse launch config, then i get exactly the error output from above.So you can reproduce the error in eclipse? That's a good sign. The trick is what should the runlevels be for your application. The eclipse launch configuration should say what the start levels are that are working. Maybe something like this?
-Dosgi.bundles=org.osgi.service.component@2:start,org.eclipse.equinox.common@2:start,org.eclipse.update.configurator@3:start,org.eclipse.core.runtime@4:start,org.eclipse.equinox.ds@5:startEclipse creates in the location
${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/Projecta config.iniosgi.splashPath=file\:C\:/C5/2_Castle5_Dev/1_Castle/castle.testenv.sysgen osgi.bundles=reference\:file\:C\:/C5/2_Castle5_Dev/1_Castle/castle.targetplatform/plugins/org.eclipse.equinox.common_3.10.0.v20180412-1130.jar@2\:start,reference\:file\:C\:/C5/2_Castle5_Dev/1_Castle/castle.targetplatform/plugins/org.eclipse.core.runtime_3.14.0.v20180417-0825.jar@start,reference\:file\:C\:/C5/2_Castle5_Dev/1_Castle/castle.extdata.autosar.v4,reference\:file\:C\:/C5/2_Castle5_Dev/1_Castle/castle.extdata.dbc,reference\:file\:C\:/C5/2_Castle5_Dev/1_Castle/castle.extdata.fibex.v3_1_0,reference\:file\:C\:/C5/2_Castle5_Dev/1_Castle/castle.extdata.ldf,reference\:file\:C\:/C5/2_Castle5_Dev/1_Castle/castle.extdata.odx_220,reference\:file\:C\:/C5/2_Castle5_Dev/1_Castle/castle.testenv.com,reference\:file\:C\:/C5/2_Castle5_Dev/1_Castle/castle.testenv.sysgen,reference\:file\:C\:/C5/2_Castle5_Dev/1_Castle/castle.util,reference\:file\:C\:/C5/2_Castle5_Dev/1_Castle/castle.targetplatform/plugins/castle.extlib.antlr.runtime_4.5.3.jar,reference\:file\:C\:/C5/2_Castle5_Dev/1_Castle/castle.targetplatform/plugins/castle.extlib.log4j-1.2.17_1.0.0.jar,reference\:file\:C\:/C5/2_Castle5_Dev/1_Castle/castle.targetplatform/plugins/javax.inject_1.0.0.v20091030.jar,reference\:file\:C\:/C5/2_Castle5_Dev/1_Castle/castle.targetplatform/plugins/javax.validation_1.1.0.v201304101302.jar,reference\:file\:C\:/C5/2_Castle5_Dev/1_Castle/castle.targetplatform/plugins/javax.xml.bind_2.2.12.v201410011542.jar,reference\:file\:C\:/C5/2_Castle5_Dev/1_Castle/castle.targetplatform/plugins/javax.xml_1.3.4.v201005080400.jar,reference\:file\:C\:/C5/2_Castle5_Dev/1_Castle/castle.targetplatform/plugins/org.apache.commons.lang3_3.1.0.v201403281430.jar,reference\:file\:C\:/C5/2_Castle5_Dev/1_Castle/castle.targetplatform/plugins/org.apache.felix.gogo.runtime_1.0.6.v20170914-1324.jar,reference\:file\:C\:/C5/2_Castle5_Dev/1_Castle/castle.targetplatform/plugins/org.apache.felix.scr_2.0.14.v20180117-1452.jar@1\:start,reference\:file\:C\:/C5/2_Castle5_Dev/1_Castle/castle.targetplatform/plugins/org.eclipse.core.contenttype_3.7.0.v20180426-1644.jar,reference\:file\:C\:/C5/2_Castle5_Dev/1_Castle/castle.targetplatform/plugins/org.eclipse.core.jobs_3.10.0.v20180427-1454.jar,reference\:file\:C\:/C5/2_Castle5_Dev/1_Castle/castle.targetplatform/plugins/org.eclipse.equinox.app_1.3.500.v20171221-2204.jar,reference\:file\:C\:/C5/2_Castle5_Dev/1_Castle/castle.targetplatform/plugins/org.eclipse.equinox.ds_1.5.100.v20171221-2204.jar@1\:start,reference\:file\:C\:/C5/2_Castle5_Dev/1_Castle/castle.targetplatform/plugins/org.eclipse.equinox.preferences_3.7.100.v20180510-1129.jar,reference\:file\:C\:/C5/2_Castle5_Dev/1_Castle/castle.targetplatform/plugins/org.eclipse.equinox.registry_3.8.0.v20180426-1327.jar,reference\:file\:C\:/C5/2_Castle5_Dev/1_Castle/castle.targetplatform/plugins/org.eclipse.jdt.annotation_2.2.0.v20180417-0931.jar,reference\:file\:C\:/C5/2_Castle5_Dev/1_Castle/castle.targetplatform/plugins/org.eclipse.osgi.compatibility.state_1.1.100.v20180331-1743.jar,reference\:file\:C\:/C5/2_Castle5_Dev/1_Castle/castle.targetplatform/plugins/org.eclipse.osgi.services_3.7.0.v20180223-1712.jar,reference\:file\:C\:/C5/2_Castle5_Dev/1_Castle/castle.targetplatform/plugins/org.eclipse.osgi.util_3.5.0.v20180219-1511.jar,reference\:file\:C\:/C5/2_Castle5_Dev/1_Castle/castle.targetplatform/plugins/org.eclipse.persistence.antlr_3.5.2.v201711011707.jar,reference\:file\:C\:/C5/2_Castle5_Dev/1_Castle/castle.targetplatform/plugins/org.eclipse.persistence.asm_6.1.1.v201804051226.jar,reference\:file\:C\:/C5/2_Castle5_Dev/1_Castle/castle.targetplatform/plugins/org.eclipse.persistence.core_2.7.2.v20180622-f627448.jar,reference\:file\:C\:/C5/2_Castle5_Dev/1_Castle/castle.targetplatform/plugins/org.eclipse.persistence.jpa.jpql_2.7.2.v20180622-f627448.jar,reference\:file\:C\:/C5/2_Castle5_Dev/1_Castle/castle.targetplatform/plugins/org.eclipse.persistence.moxy_2.7.2.v20180622-f627448.jar osgi.install.area=file\:C\:\\C5\\2_Castle5_Dev\\1_Castle\\castle.util\\..\\castle.targetplatform osgi.bundles.defaultStartLevel=4 osgi.framework=file\:C\:/C5/2_Castle5_Dev/1_Castle/castle.targetplatform/plugins/org.eclipse.osgi_3.13.0.v20180409-1500.jar osgi.configuration.cascaded=falseThis works, so i try to get the
osgi.bundlesfrom here.
Beside the original and others, I tried these variants://it.vmArgs = ['-Dosgi.bundles=reference:file:plugins/org.eclipse.equinox.common_3.10.0.v20180412-1130.jar@2:start,reference:file:plugins/org.eclipse.core.runtime_3.14.0.v20180417-0825.jar@start,reference:file:plugins/castle.extdata.autosar.v4,reference:file:plugins/castle.extdata.dbc,reference:file:plugins/castle.extdata.fibex.v3_1_0,reference:file:plugins/castle.extdata.ldf,reference:file:plugins/castle.extdata.odx_220,reference:file:plugins/castle.testenv.com,reference:file:plugins/castle.testenv.sysgen,reference:file:plugins/castle.util,reference:file:plugins/castle.extlib.antlr.runtime_4.5.3.jar,reference:file:plugins/castle.extlib.log4j-1.2.17_1.0.0.jar,reference:file:plugins/javax.inject_1.0.0.v20091030.jar,reference:file:plugins/javax.validation_1.1.0.v201304101302.jar,reference:file:plugins/javax.xml.bind_2.2.12.v201410011542.jar,reference:file:plugins/javax.xml_1.3.4.v201005080400.jar,reference:file:plugins/org.apache.commons.lang3_3.1.0.v201403281430.jar,reference:file:plugins/org.apache.felix.gogo.runtime_1.0.6.v20170914-1324.jar,reference:file:plugins/org.apache.felix.scr_2.0.14.v20180117-1452.jar@1:start,reference:file:plugins/org.eclipse.core.contenttype_3.7.0.v20180426-1644.jar,reference:file:plugins/org.eclipse.core.jobs_3.10.0.v20180427-1454.jar,reference:file:plugins/org.eclipse.equinox.app_1.3.500.v20171221-2204.jar,reference:file:plugins/org.eclipse.equinox.ds_1.5.100.v20171221-2204.jar@1:start,reference:file:plugins/org.eclipse.equinox.preferences_3.7.100.v20180510-1129.jar,reference:file:plugins/org.eclipse.equinox.registry_3.8.0.v20180426-1327.jar,reference:file:plugins/org.eclipse.jdt.annotation_2.2.0.v20180417-0931.jar,reference:file:plugins/org.eclipse.osgi.compatibility.state_1.1.100.v20180331-1743.jar,reference:file:plugins/org.eclipse.osgi.services_3.7.0.v20180223-1712.jar,reference:file:plugins/org.eclipse.osgi.util_3.5.0.v20180219-1511.jar,reference:file:plugins/org.eclipse.persistence.antlr_3.5.2.v201711011707.jar,reference:file:plugins/org.eclipse.persistence.asm_6.1.1.v201804051226.jar,reference:file:plugins/org.eclipse.persistence.core_2.7.2.v20180622-f627448.jar,reference:file:plugins/org.eclipse.persistence.jpa.jpql_2.7.2.v20180622-f627448.jar,reference:file:plugins/org.eclipse.persistence.moxy_2.7.2.v20180622-f627448.jar'] //it.vmArgs = ['-Dosgi.bundles=org.eclipse.equinox.common@2:start,org.eclipse.core.runtime@start,castle.extdata.autosar.v4,castle.extdata.dbc,castle.extdata.fibex.v3_1_0,castle.extdata.ldf,castle.extdata.odx_220,castle.testenv.com,castle.testenv.sysgen,castle.util,castle.extlib.antlr.runtime,castle.extlib.log4j-1.2.17,javax.inject,javax.validation,javax.xml.bind,javax.xml,org.apache.commons.lang3,org.apache.felix.gogo.runtime,org.apache.felix.scr@1:start,org.eclipse.core.contenttype,org.eclipse.core.jobs,org.eclipse.equinox.app,org.eclipse.equinox.ds@1:start,org.eclipse.equinox.preferences,org.eclipse.equinox.registry,org.eclipse.jdt.annotation,org.eclipse.osgi.compatibility.state,org.eclipse.osgi.services,org.eclipse.osgi.util,org.eclipse.persistence.antlr,org.eclipse.persistence.asm,org.eclipse.persistence.core,org.eclipse.persistence.jpa.jpql,org.eclipse.persistence.moxy'] //it.vmArgs = ['-Dosgi.bundles=org.eclipse.equinox.common@2:start,org.eclipse.core.runtime@start,castle.extlib.log4j-1.2.17,javax.inject,javax.validation,javax.xml.bind,javax.xml,org.apache.commons.lang3,org.apache.felix.gogo.runtime,org.apache.felix.scr@1:start,org.eclipse.core.contenttype,org.eclipse.core.jobs,org.eclipse.equinox.app,org.eclipse.equinox.ds@1:start,org.eclipse.equinox.preferences,org.eclipse.equinox.registry,org.eclipse.jdt.annotation,org.eclipse.osgi.compatibility.state,org.eclipse.osgi.services,org.eclipse.osgi.util,org.eclipse.persistence.antlr,org.eclipse.persistence.asm,org.eclipse.persistence.core,org.eclipse.persistence.jpa.jpql,org.eclipse.persistence.moxy'] it.vmArgs = ['-Dosgi.bundles=org.eclipse.equinox.common@2:start,org.eclipse.core.runtime@start,org.apache.felix.scr@1:start,org.eclipse.equinox.ds@1:start']But the error message in gradle seems to be always the same.
Perhaps this?
-Dequinox.use.ds=falseThere must be some default which is different between EquinoxLauncher and eclipse. Confusing that it's a new issue with 4.8...
goomph/src/main/java/com/diffplug/gradle/eclipserunner/EquinoxLauncher.java
Lines 132 to 145 in af5fc92
* map.put("osgi.framework.useSystemProperties", "false"); * map.put("osgi.install.area", <installation root>); * map.put("osgi.noShutdown", "false"); * // enable * map.put("equinox.use.ds", "true"); * map.put("osgi.bundles", Joiner.on(", ").join( * // automatic bundle discovery and installation * "org.eclipse.equinox.common@2:start", * "org.eclipse.update.configurator@3:start", * // support eclipse's -application argument * "org.eclipse.core.runtime@4:start", * // declarative services * "org.eclipse.equinox.ds@5:start")); * map.put(EclipseStarter.PROP_FRAMEWORK, <path to plugin "org.eclipse.osgi">); I could find a workaround.
The problem is triggered by the latest org.eclipse.update.configurator.
I re-added the version 3.3.400 to the targetplatform, all other plugins are from Eclipse 4.8.
Whenever i change in build.gradle to use the latest org.eclipse.update.configurator_3.4.0.v20180512-1141.jar the EquinoxLauncher gives the above missleading errors.Interesting! Not much has changed in it: https://github.com/eclipse/eclipse.platform/commits/master/update/org.eclipse.update.configurator
Are you running on Java 9 perhaps? https://github.com/eclipse/eclipse.platform/commit/0afed29e9fab7a169ac8eaaa733c8cf8e356b9b6#diff-c70a817762e12d58a72e93d56f5dfbe6
my gradle runs with java.version=1.8.0_92
my eclipse installation itself is running with JDK 10.0, but when starting the application, it uses the installed JRE 1.8.u131.Hi, I've just come across this problem when trying to launch my Eclipse-based RCP application (see archimatetool/archi#429) with this config.ini file:
eclipse.application=com.archimatetool.editor.app osgi.bundles.defaultStartLevel=4 eclipse.product=com.archimatetool.editor.product osgi.splashPath=platform:/base/plugins/com.archimatetool.editor osgi.bundles=org.eclipse.equinox.common@2:start,org.eclipse.update.configurator@3:start,org.eclipse.equinox.ds@3:start,org.eclipse.core.runtime@startLike you, I replaced
org.eclipse.update.configurator_3.4.100.v20180821-1913(comes with Eclipse 3.9) with versionorg.eclipse.update.configurator_3.3.400.v20160506-0750.jarfrom Eclipse 3.7 and it fixed the problem of not launching the app.I'm running Java 1.8.
Did you figure out what could cause this? Is it a bug in org.eclipse.update.configurator?
Sorry, I have no more information, I just live with the older configurator in my SW. And I hope future Eclipse updates will not have problems with this.
See https://bugs.eclipse.org/bugs/show_bug.cgi?id=542706 - is this the issue?
If you're having trouble launching OSGi applications, it's worth checking out Solstice.
Hi Ned,
i use the equinoxLaunch task to start a code generator application in the build.
This worked with diffplug 3.14 plugin.
Now i updated the bundles for my application and adjusted the runtime dependencies.
It fails, also with diffplug 3.15.
The javax.inject did not changed at all.
I double checked all jar name changes.
Now I am a bit lost, if this is a build.gradle problem, a problem with the updated jars, or a problem with the diffplug.
Can you give a hint how to go on from here?
Frank