tail
tail

Reputation: 431

Missing Constraint: Require-Capability: osgi.ee when validating plug-ins

I inherited an Eclipse RCP application (org.eclipse.e4.ui.workbench.swt.E4Application) from my colleague.

When I click on Launch an Eclipse application in the MyApp.product overview panel, I get many warnings when validating my plug-ins like these:

warnings

If I click on Continue I get a launch error:

The application could not start

And this is the log:

!ENTRY org.eclipse.equinox.simpleconfigurator 4 0 2024-04-12 12:25:03.832
!MESSAGE FrameworkEvent ERROR
!STACK 0
org.osgi.framework.BundleException: Could not resolve module: org.eclipse.equinox.simpleconfigurator [1]
  Unresolved requirement: Require-Capability: osgi.ee; filter:="(&(osgi.ee=JavaSE)(version=17))"

    at org.eclipse.osgi.container.Module.start(Module.java:493)
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel$2.run(ModuleContainer.java:2073)
    at org.eclipse.osgi.internal.framework.EquinoxContainerAdaptor$1$1.execute(EquinoxContainerAdaptor.java:143)
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:2064)
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:2006)
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1967)
    at org.eclipse.osgi.container.SystemModule.startWorker(SystemModule.java:274)
    at org.eclipse.osgi.container.Module.doStart(Module.java:639)
    at org.eclipse.osgi.container.Module.start(Module.java:498)
    at org.eclipse.osgi.container.SystemModule.start(SystemModule.java:198)
    at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:463)
    at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:482)
    at org.eclipse.osgi.launch.Equinox.start(Equinox.java:139)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.startup(EclipseStarter.java:367)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:267)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:651)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:588)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1459)
    at org.eclipse.equinox.launcher.Main.main(Main.java:1432)

!ENTRY org.eclipse.osgi 4 0 2024-04-12 12:25:03.832
!MESSAGE Bundle initial@reference:file:plugins/org.eclipse.equinox.simpleconfigurator_1.5.200.v20240209-1053.jar was not resolved.

!ENTRY org.eclipse.equinox.simpleconfigurator 2 0 2024-04-12 12:25:03.847
!MESSAGE Could not resolve module: org.eclipse.equinox.simpleconfigurator [1]
  Unresolved requirement: Require-Capability: osgi.ee; filter:="(&(osgi.ee=JavaSE)(version=17))"


!ENTRY org.eclipse.osgi 4 0 2024-04-12 12:25:03.847
!MESSAGE Application error
!STACK 1
java.lang.IllegalStateException: Unable to acquire application service. Ensure that the org.eclipse.core.runtime bundle is resolved and started (see config.ini).
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:86)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:439)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:271)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:651)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:588)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1459)
    at org.eclipse.equinox.launcher.Main.main(Main.java:1432)

I googled and found a possible solution but clicking on Run configurations > Plug-ins > Add required plug-ins won't fix the issue. Another solution, which won't work, is here.

This is the META-INF/MANIFEST.MF file, if you need it:

Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: MyBundle
Bundle-SymbolicName: com.mycompany.myapp;singleton:=true
Bundle-Version: 1.0.0
Bundle-ClassPath: .,
  swing2swt.jar
Bundle-Activator: com.mycompany.myapp.managers.Activator
Bundle-Vendor: mycompany
Export-Package: com.mycompany.mybundle.log.log4j,
  com.mycompany.myapp.data,
  com.mycompany.myapp.dialogs,
  com.mycompany.myapp.handlers,
  com.mycompany.myapp.listeners,
  com.mycompany.myapp.managers,
  com.mycompany.myapp.parts,
  com.mycompany.myapp.providers,
  com.mycompany.myapp.table,
  com.mycompany.myapp.utils,
  com.mycompany.myapp.utils.filesystem,
  com.mycompany.myapp.views
Require-Bundle: org.eclipse.e4.ui.model.workbench;bundle-version="1.0.1",
 org.eclipse.e4.ui.services;bundle-version="1.0.1",
 org.eclipse.e4.ui.workbench;bundle-version="1.0.2",
 org.eclipse.e4.core.di;bundle-version="1.3.0",
 org.eclipse.e4.ui.di;bundle-version="1.0.0",
 org.eclipse.e4.core.contexts;bundle-version="1.3.1",
 org.eclipse.nebula.visualization.xygraph;bundle-version="3.1.0",
 org.eclipse.nebula.widgets.nattable.extension.glazedlists;bundle-version="2.0.0",
 ca.odell.glazedlists;bundle-version="1.9.0",
 org.eclipse.osgi.services,
 org.eclipse.emf.common.ui;bundle-version="2.13.0",
 org.eclipse.emf.ecore.xmi;bundle-version="2.14.0",
 com.mycompany.tmlibrary,
 com.mycompany.applicationManager;bundle-version="1.0.0",
 org.eclipse.draw2d,
 org.eclipse.nebula.widgets.nattable.core;bundle-version="2.0.0",
 org.apache.poi,
 org.eclipse.osgi;bundle-version="3.12.0",
 org.apache.servicemix.bundles.jaxen;bundle-version="1.1.6"
Bundle-ActivationPolicy: lazy
Import-Package: com.mycompany.application.configurations,
 com.mycompany.tmlibrary.configuration,
 com.mycompany.tmlibrary.files,
 com.mycompany.tmlibrary.files.zte,
 com.mycompany.tmlibrary.utils,
 com.mycompany.tool.utils,
 com.mycompany.myapp.managers,
 javax.annotation;version="1.0.0",
 javax.inject;version="1.0.0",
 org.apache.commons.compress.archivers.tar;version="1.6.0",
 org.apache.commons.compress.compressors.gzip;version="1.6.0",
 org.eclipse.core.runtime;version="3.5.0",
 org.eclipse.core.runtime.jobs,
 org.eclipse.e4.core.services.events,
 org.eclipse.equinox.app;version="1.1.0"
Bundle-RequiredExecutionEnvironment: JavaSE-1.8

How can I solve?

Upvotes: 0

Views: 131

Answers (0)

Related Questions