diffplug / goomph

IDE as build artifact
Apache License 2.0
130 stars 30 forks source link

equinoxLaunch problem with Eclipse 4.8 Targetplatform #69

Closed frankbenoit closed 1 year ago

frankbenoit commented 6 years ago

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.

> Task :sysgenApp
!SESSION 2018-07-07 17:12:43.164 -----------------------------------------------
eclipse.buildId=unknown
java.version=1.8.0_92
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=de_DE
Framework arguments:  -application castle.testenv.sysgen.application
Command-line arguments:  -consoleLog -application castle.testenv.sysgen.application

!ENTRY org.eclipse.core.runtime 4 0 2018-07-07 17:12:43.194
!MESSAGE FrameworkEvent ERROR
!STACK 0
org.osgi.framework.BundleException: Could not resolve module: org.eclipse.core.runtime [3]
  Unresolved requirement: Require-Bundle: javax.inject; bundle-version="1.0.0"; visibility:="reexport"; resolution:="opt
ional"
  Unresolved requirement: Require-Bundle: org.eclipse.core.jobs; bundle-version="[3.2.0,4.0.0)"; visibility:="reexport"

        at org.eclipse.osgi.container.Module.start(Module.java:444)
        at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1634)
        at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1614)
        at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:158
5)
        at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1528)
        at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1)
        at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
        at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)

!ENTRY org.eclipse.equinox.ds 4 0 2018-07-07 17:12:43.202
!MESSAGE FrameworkEvent ERROR
!STACK 0
org.osgi.framework.BundleException: Could not resolve module: org.eclipse.equinox.ds [4]
  Unresolved requirement: Import-Package: org.osgi.service.component; version="1.3.0"

        at org.eclipse.osgi.container.Module.start(Module.java:444)
        at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1634)
        at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1614)
        at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:158
5)
        at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1528)
        at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1)
        at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
        at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)

!ENTRY org.eclipse.osgi 4 0 2018-07-07 17:12:43.209
!MESSAGE Bundle initial@reference:file:plugins/org.eclipse.core.runtime_3.14.0.v20180417-0825.jar was not resolved.

!ENTRY org.eclipse.osgi 4 0 2018-07-07 17:12:43.211
!MESSAGE Bundle initial@reference:file:plugins/org.eclipse.equinox.ds_1.5.100.v20171221-2204.jar was not resolved.

!ENTRY org.eclipse.equinox.ds 2 0 2018-07-07 17:12:43.218
!MESSAGE Could not resolve module: org.eclipse.equinox.ds [4]
  Unresolved requirement: Import-Package: org.osgi.service.component; version="1.3.0"

!ENTRY org.eclipse.core.runtime 2 0 2018-07-07 17:12:43.220
!MESSAGE Could not resolve module: org.eclipse.core.runtime [3]
  Unresolved requirement: Require-Bundle: javax.inject; bundle-version="1.0.0"; visibility:="reexport"; resolution:="opt
ional"
  Unresolved requirement: Require-Bundle: org.eclipse.core.jobs; bundle-version="[3.2.0,4.0.0)"; visibility:="reexport"

> Task :sysgenApp FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':sysgenApp'.
> Unable to acquire application service. Ensure that the org.eclipse.core.runtime bundle is resolved and started (see co
nfig.ini).

* Try:
Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':sysgenApp'.
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.
java:103)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:73
)
        at org.gradle.api.internal.tasks.execution.OutputDirectoryCreatingTaskExecuter.execute(OutputDirectoryCreatingTa
skExecuter.java:51)
        at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:59)
        at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachin
gStateExecuter.java:54)
        at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:59)
        at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExec
uter.java:101)
        at org.gradle.api.internal.tasks.execution.FinalizeInputFilePropertiesTaskExecuter.execute(FinalizeInputFileProp
ertiesTaskExecuter.java:44)
        at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:
91)
        at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactState
TaskExecuter.java:62)
        at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.j
ava:59)
        at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54)
        at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.j
ava:43)
        at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34
)
        at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.run(DefaultTaskGraphExecuter.
java:256)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuil
dOperationExecutor.java:317)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuil
dOperationExecutor.java:309)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:185)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:97)
        at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)

        at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecute
r.java:249)
        at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecute
r.java:238)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.j
ava:104)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.j
ava:98)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.execute(DefaultTaskExecutionPlan.java:663)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.executeWithTask(DefaultTaskExecutionPlan.java:596)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.run(DefaultTaskPlanExecutor.java:98
)
        at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
        at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
        at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
Caused by: java.lang.IllegalStateException: Unable to acquire application service. Ensure that the org.eclipse.core.runt
ime bundle is resolved and started (see config.ini).
        at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:78)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:388)
        at com.diffplug.gradle.eclipserunner.EquinoxLauncher$Running.run(EquinoxLauncher.java:192)
        at com.diffplug.gradle.eclipserunner.EquinoxLauncher$Running.access$100(EquinoxLauncher.java:174)
        at com.diffplug.gradle.eclipserunner.EquinoxLauncher.run(EquinoxLauncher.java:165)
        at com.diffplug.gradle.eclipserunner.JarFolderRunner.run(JarFolderRunner.java:36)
        at com.diffplug.gradle.eclipserunner.JarFolderRunnerExternalJvm$RunOutside.run(JarFolderRunnerExternalJvm.java:1
20)
        at com.diffplug.gradle.JavaExecable.main(JavaExecable.java:134)

* Get more help at https://help.gradle.org

BUILD FAILED in 18s
38 actionable tasks: 3 executed, 35 up-to-date

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

frankbenoit commented 6 years ago

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.jar

Import-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.

nedtwigg commented 6 years ago

Is the issue perhaps related to runlevels? These are the defaults:

https://github.com/diffplug/goomph/blob/5de48d5c4a09e87111044ed43d00dfbda2721df6/src/main/java/com/diffplug/gradle/eclipserunner/EquinoxLauncher.java#L219-L229

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?

frankbenoit commented 6 years ago

How can i overwrite those "osgi.bundles" from within the build.gradle. I cannot figure out the syntax. Can you please help?

nedtwigg commented 6 years ago

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.

frankbenoit commented 6 years ago

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@start

and the osgi.bundles.defaultStartLevel=4

frankbenoit commented 6 years ago

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.jar
nedtwigg commented 6 years ago
buildscript { 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']
      }
    }
  }
}
frankbenoit commented 6 years ago

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@start to the VM args in the Eclipse launch config, then i get exactly the error output from above.

nedtwigg commented 6 years ago

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:start

frankbenoit commented 6 years ago

Eclipse creates in the location ${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/Project a config.ini

osgi.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=false

This works, so i try to get the osgi.bundles from 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.

nedtwigg commented 6 years ago

Perhaps this? -Dequinox.use.ds=false

There must be some default which is different between EquinoxLauncher and eclipse. Confusing that it's a new issue with 4.8...

https://github.com/diffplug/goomph/blob/af5fc92d98b1e622c44c423cdf3bf5c984562b7b/src/main/java/com/diffplug/gradle/eclipserunner/EquinoxLauncher.java#L132-L145

frankbenoit commented 6 years ago

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.

nedtwigg commented 6 years ago

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

frankbenoit commented 6 years ago

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.

Phillipus commented 5 years ago

Hi, I've just come across this problem when trying to launch my Eclipse-based RCP application (see https://github.com/archimatetool/archi/issues/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@start

Like you, I replaced org.eclipse.update.configurator_3.4.100.v20180821-1913 (comes with Eclipse 3.9) with version org.eclipse.update.configurator_3.3.400.v20160506-0750.jar from 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?

frankbenoit commented 5 years ago

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.

Phillipus commented 5 years ago

See https://bugs.eclipse.org/bugs/show_bug.cgi?id=542706 - is this the issue?

nedtwigg commented 1 year ago

If you're having trouble launching OSGi applications, it's worth checking out Solstice.