Repository navigation
Closed
Labels
Description
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
Activity
frankbenoit commentedon Jul 7, 2018
in the folder
build\headlessAppSetup\plugins
i find those jars:
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 commentedon Jul 8, 2018
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
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 commentedon Jul 8, 2018
How can i overwrite those "osgi.bundles" from within the build.gradle. I cannot figure out the syntax.
Can you please help?
nedtwigg commentedon Jul 8, 2018
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:
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 commentedon Jul 8, 2018
Thanks for the addition.
Unfortunately i don't get how to apply your snippet on my existing equinoxLaunch:
In the working eclipse launch directory, i found the information:
With startlevel param:
and the osgi.bundles.defaultStartLevel=4
frankbenoit commentedon Jul 8, 2018
Gradle gives me:
nedtwigg commentedon Jul 8, 2018
frankbenoit commentedon Jul 8, 2018
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.nedtwigg commentedon Jul 9, 2018
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:startfrankbenoit commentedon Jul 9, 2018
Eclipse creates in the location
${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/Projecta config.iniThis works, so i try to get the
osgi.bundlesfrom here.Beside the original and others, I tried these variants:
But the error message in gradle seems to be always the same.
nedtwigg commentedon Jul 9, 2018
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
frankbenoit commentedon Jul 10, 2018
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 commentedon Jul 10, 2018
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 commentedon Jul 10, 2018
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 commentedon Jan 14, 2019
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:
Like 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?
frankbenoit commentedon Jan 14, 2019
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 commentedon Jan 14, 2019
See https://bugs.eclipse.org/bugs/show_bug.cgi?id=542706 - is this the issue?
nedtwigg commentedon Mar 1, 2023
If you're having trouble launching OSGi applications, it's worth checking out Solstice.