How to resolve missing required bundle for SonarLint eclipse - eclipse

I am having a problem loading SonarLint 2.2.0 in my Eclipse Luna. The official web document says that 2.2.0 version is supported for Eclipse Luna. I also can install SonarLint from Eclipse Marketplace without any problem. But on eclipse restart, SonarLint cannot load. Diagnosing the plugin, I found that there are some missing bundles as shown in image below.
While checking the bundle from OSGI console, I had the bundle and it was in ACTIVE status but of different version as shown below.
Looking at this, I don't think I should downgrade equinox to version 0.0.0 if there's any. And not sure how can I deal with it. Any help would be appreciated guys.
Thanks

Version 2.2.0 of SonarLint for Eclipse moved to Java 8 (as well as the library SonarLint Core). As a consequence, the MANIFEST of all those bundle was updated to require JavaSE-1.8 execution environment.
If your Eclipse installation is not able to provide this requirement, the SonarLint plugin will not be loaded. I agree this silent failure is a shame, but if you have an idea on how to improve, let me know.
Possible reasons why your Eclipse doesn't provide JavaSE-1.8:
Eclipse was started with Java < 8. To be sure simply open Help -> About Eclipse -> Installation details -> Configuration and look for property java.version. Here the solution is simple: run Eclipse with a JVM 1.8+.
You are using a very old Eclipse version (< Kepler SR1). There is no Java 1.8 profile so it will not work even if you use a JVM 1.8 (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=387699). Luna is supposed to be supported, but if you upgraded from an older version of Eclipse if may be broken (see How do I add execution environment 1.8 to Eclipse Luna?). Try with a fresh installation of Luna or a more recent version.

I'm seeing the same issue and ran diag in the OSGi console.
I've found that the SonarLint eclipse bundles have references to 2.3.1 versions of the core SonarLint bundles, while the plug-in payload includes the 2.4.0 versions of the core packages.
For example: The diag command shows that the sonarlint.eclipse.core bundle is referencing sonarlint-client-api_2.3.1 while the plug-in payload includes sonarlint-client-api_2.4.0.
Note: I'm seeing the same version issue at the bottom of the diag window provided by the OP.
I'm thinking the SonarLint 2.2 bundle needs to be rebuilt/repackaged with the correct package versions.
Here's my OSGi console output for reference.
osgi> ss
...
1241 INSTALLED org.sonarlint.eclipse.core_2.2.0.201607291419-RELEASE
1242 INSTALLED org.sonarlint.eclipse.jdt_2.2.0.201607291419-RELEASE
1243 INSTALLED org.sonarlint.eclipse.ui_2.2.0.201607291419-RELEASE
1244 INSTALLED org.sonarsource.sonarlint.core.sonarlint-client-api_2.4.0
1245 INSTALLED org.sonarsource.sonarlint.core.sonarlint-core_2.4.0
osgi> diag 1241
reference:file:plugins/org.sonarlint.eclipse.core_2.2.0.201607291419-RELEASE.jar [1241]
Direct constraints which are unresolved:
Missing required bundle org.sonarsource.sonarlint.core.sonarlint-client-api_2.3.1.
Missing required bundle org.sonarsource.sonarlint.core.sonarlint-core_2.3.1.
Missing required capability Require-Capability: osgi.ee; filter="(&(osgi.ee=JavaSE)(version=1.8))".
Leaf constraints in the dependency chain which are unresolved:
reference:file:plugins/org.sonarsource.sonarlint.core.sonarlint-core_2.4.0.jar [1245]
Missing required capability Require-Capability: osgi.ee; filter="(&(osgi.ee=JavaSE)(version=1.8))".
reference:file:plugins/org.sonarsource.sonarlint.core.sonarlint-client-api_2.4.0.jar [1244]
Missing required capability Require-Capability: osgi.ee; filter="(&(osgi.ee=JavaSE)(version=1.8))".
osgi> diag 1242
reference:file:plugins/org.sonarlint.eclipse.jdt_2.2.0.201607291419-RELEASE.jar [1242]
Direct constraints which are unresolved:
Missing required bundle org.sonarlint.eclipse.core_0.0.0.
Missing required capability Require-Capability: osgi.ee; filter="(&(osgi.ee=JavaSE)(version=1.8))".
Leaf constraints in the dependency chain which are unresolved:
reference:file:plugins/org.sonarsource.sonarlint.core.sonarlint-core_2.4.0.jar [1245]
Missing required capability Require-Capability: osgi.ee; filter="(&(osgi.ee=JavaSE)(version=1.8))".
reference:file:plugins/org.sonarsource.sonarlint.core.sonarlint-client-api_2.4.0.jar [1244]
Missing required capability Require-Capability: osgi.ee; filter="(&(osgi.ee=JavaSE)(version=1.8))".
reference:file:plugins/org.sonarlint.eclipse.core_2.2.0.201607291419-RELEASE.jar [1241]
Missing required capability Require-Capability: osgi.ee; filter="(&(osgi.ee=JavaSE)(version=1.8))".
osgi> diag 1243
reference:file:plugins/org.sonarlint.eclipse.ui_2.2.0.201607291419-RELEASE.jar [1243]
Direct constraints which are unresolved:
Missing required bundle org.sonarlint.eclipse.core_0.0.0.
Missing imported package org.sonarsource.sonarlint.core.client.api.connected_0.0.0.
Missing imported package org.sonarsource.sonarlint.core.client.api.util_0.0.0.
Missing required capability Require-Capability: osgi.ee; filter="(&(osgi.ee=JavaSE)(version=1.8))".
Leaf constraints in the dependency chain which are unresolved:
reference:file:plugins/org.sonarsource.sonarlint.core.sonarlint-core_2.4.0.jar [1245]
Missing required capability Require-Capability: osgi.ee; filter="(&(osgi.ee=JavaSE)(version=1.8))".
reference:file:plugins/org.sonarsource.sonarlint.core.sonarlint-client-api_2.4.0.jar [1244]
Missing required capability Require-Capability: osgi.ee; filter="(&(osgi.ee=JavaSE)(version=1.8))".
reference:file:plugins/org.sonarlint.eclipse.core_2.2.0.201607291419-RELEASE.jar [1241]
Missing required capability Require-Capability: osgi.ee; filter="(&(osgi.ee=JavaSE)(version=1.8))".
osgi> diag 1244
reference:file:plugins/org.sonarsource.sonarlint.core.sonarlint-client-api_2.4.0.jar [1244]
Direct constraints which are unresolved:
Missing required capability Require-Capability: osgi.ee; filter="(&(osgi.ee=JavaSE)(version=1.8))".
osgi> diag 1245
reference:file:plugins/org.sonarsource.sonarlint.core.sonarlint-core_2.4.0.jar [1245]
Direct constraints which are unresolved:
Missing required bundle org.sonarsource.sonarlint.core.sonarlint-client-api_2.4.0.
Missing required capability Require-Capability: osgi.ee; filter="(&(osgi.ee=JavaSE)(version=1.8))".
Leaf constraints in the dependency chain which are unresolved:
reference:file:plugins/org.sonarsource.sonarlint.core.sonarlint-client-api_2.4.0.jar [1244]
Missing required capability Require-Capability: osgi.ee; filter="(&(osgi.ee=JavaSE)(version=1.8))".

Have you added the these plugins as a 'Required-Bundle' in your Manifest?

Related

Eclipse RCP product export: Cannot satisfy slf4j dependency

I am building existing RCP application against this target platform:
The PDE build worked fine just few weeks ago and then something happened, presumably Eclipse updated itself? or something like this.. Now I am getting this dependency error which makes no sense because by the look of it the required plugin and exported package is present in the target platform. If I disable p2 "Generate p2 repository" in the export dialog, the build works fine.
Property "p2.director.log" has not been set
[p2.director] Installing com.myclient.product 5.2.0.
[p2.director] Installation failed.
[p2.director] Cannot complete the install because one or more required items could not be found.
[p2.director] Software being installed: logFaces 5.2.0 (com.myclient.product 5.2.0)
[p2.director] Missing requirement: Apache HttpClient 5.1.2.v20211217-1500 (org.apache.httpcomponents.client5.httpclient5 5.1.2.v20211217-1500) requires 'java.package; org.slf4j [1.7.25,2.0.0)' but it could not be found
[p2.director] Cannot satisfy dependency:
[p2.director] From: logFaces 5.2.0 (com.myclient.product 5.2.0)
[p2.director] To: org.eclipse.equinox.p2.iu; org.eclipse.equinox.p2.core.feature.feature.group [1.6.1300.v20220223-1131,1.6.1300.v20220223-1131]
[p2.director] Cannot satisfy dependency:
[p2.director] From: ECF Apache Httpclient 5 FileTransfer Provider 1.1.600.v20220215-0126 (org.eclipse.ecf.filetransfer.httpclient5.feature.feature.group 1.1.600.v20220215-0126)
[p2.director] To: org.eclipse.equinox.p2.iu; org.apache.httpcomponents.client5.httpclient5 [5.1.2.v20211217-1500,5.1.2.v20211217-1500]
[p2.director] Cannot satisfy dependency:
[p2.director] From: Equinox p2, headless functionalities 1.6.1300.v20220223-1131 (org.eclipse.equinox.p2.core.feature.feature.group 1.6.1300.v20220223-1131)
[p2.director] To: org.eclipse.equinox.p2.iu; org.eclipse.ecf.filetransfer.httpclient5.feature.feature.group [1.0.0,2.0.0)
[p2.director] Cannot complete the install because one or more required items could not be found.
[p2.director] Software being installed: logFaces 5.2.0 (com.myclient.product 5.2.0)
[p2.director] Missing requirement: Apache HttpClient 5.1.2.v20211217-1500 (org.apache.httpcomponents.client5.httpclient5 5.1.2.v20211217-1500) requires 'java.package; org.slf4j [1.7.25,2.0.0)' but it could not be found
[p2.director] Cannot satisfy dependency:
[p2.director] Cannot satisfy dependency:
[p2.director] Cannot satisfy dependency:
A problem occured while invoking the director.
runDirector: duration 0 seconds
I would appreciate any help from the community on this one, thank you in advance!

Eclipse RCP export: missing dependencies in target platform

I am trying to build existing RCP application against new target platform in order to get macosx(cocoa/aarch64). Using this update site: https://download.eclipse.org/eclipse/updates/4.23-I-builds.
The application works fine but when trying to export the RCP product with the wizard I get the following errors in the pde build log file:
Property "p2.director.log" has not been set
[p2.director] Installing com.client.product 5.1.0.
[p2.director] Installation failed.
[p2.director] Cannot complete the install because one or more required items could not be found.
[p2.director] Software being installed: PRODUCT 5.1.0 (com.client.product 5.1.0)
[p2.director] Missing requirement: Equinox p2, headless functionalities 1.6.1300.v20220127-1112 (org.eclipse.equinox.p2.core.feature.feature.group 1.6.1300.v20220127-1112) requires 'org.eclipse.equinox.p2.iu; org.eclipse.ecf.filetransfer.httpclient5.feature.feature.group [1.0.0,2.0.0)' but it could not be found
[p2.director] Cannot satisfy dependency:
[p2.director] From: PRODUCT 5.1.0 (com.client.product 5.1.0)
[p2.director] To: org.eclipse.equinox.p2.iu; org.eclipse.equinox.p2.core.feature.feature.group [1.6.1300.v20220127-1112,1.6.1300.v20220127-1112]
[p2.director] Cannot complete the install because one or more required items could not be found.
[p2.director] Software being installed: PRODUCT 5.1.0 (com.client.product 5.1.0)
[p2.director] Missing requirement: Equinox p2, headless functionalities 1.6.1300.v20220127-1112 (org.eclipse.equinox.p2.core.feature.feature.group 1.6.1300.v20220127-1112) requires 'org.eclipse.equinox.p2.iu; org.eclipse.ecf.filetransfer.httpclient5.feature.feature.group [1.0.0,2.0.0)' but it could not be found
[p2.director] Cannot satisfy dependency:
A problem occured while invoking the director.
runDirector: duration 0 seconds
It appears that the following plugins can't be found:
org.eclipse.equinox.p2.iu;
org.eclipse.ecf.filetransfer.httpclient5.feature.feature.group
What should I include in my target platform in order to resolve this?

Eclipse RCP new plug-in dependency unresolved requirement

I am learning RCP plug-ins and trying to add another plug-in as a dependency. So I started with a simple HelloWorld application and tested and it works fine. Now I created another plug-in by importing external jar files and added that as dependent on my HelloWorld application. Now when I run the code I get the following error,
!ENTRY org.eclipse.equinox.app 0 0 2018-10-08 13:39:55.300
!MESSAGE Product com.be.tests.part1.product1 could not be found.
!ENTRY com.be.tests.part1 4 0 2018-10-08 13:39:55.315
!MESSAGE FrameworkEvent ERROR
!STACK 0
org.osgi.framework.BundleException: Could not resolve module: com.be.tests.part1 [73]
Unresolved requirement: Require-Bundle: Part1Libs; bundle-version="1.0.0"
I have added the new plug-in (Part1Libs) in the dependencies tab. The
MANIFEST.MF file shows the dependency as
Require-Bundle: org.eclipse.ui.intro,
org.eclipse.core.runtime,
org.eclipse.ui,
org.eclipse.equinox.ds,
org.eclipse.equinox.util,
org.eclipse.equinox.event,
Part1Libs;bundle-version="1.0.0"
It looks like I am missing a simple step but I can't figure out what is going on. Any help is greatly appreciated,
Look in the 'Run > Run Configurations...' dialog and find your RCP.
On the 'Plug-ins' tab ensure that all the plugins in your RCP are listed.

Tycho build error: "... requires bundle ... but it could not be found"

We have an eclipse Luna plugin application which we're trying to build with Tycho. When we try to do a mvn clean verify, we're getting this type of message:
[ERROR] Cannot resolve project dependencies:
[ERROR] Software being installed: our.app 1.0.0.qualifier
[ERROR] Missing requirement: our.app 1.0.0.qualifier requires 'bundle org.eclipse.core.runtime 3.7.0' but it could not be found
When we look at the logs it appears that any Eclipse plugin that is required will give us this error, and that this is merely the first item in the list on the MANIFEST.MF for the plugin being verified.
I have looked at other questions, but none of them seem to address this particular issue. Any suggestions would be greatly appreciated.
MANIFEST.MF:
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Our App
Bundle-SymbolicName: our.app;singleton:=true
Built-By: Our Team (2014)
Bundle-ClassPath: .,
<some jars>
Bundle-Vendor: Our Team
Require-Bundle: org.eclipse.core.runtime;bundle-version="3.7.0",
org.eclipse.ui;bundle-version="3.7.0",
org.eclipse.ui.ide;bundle-version="3.7.0",
org.eclipse.core.resources;bundle-version="3.7.0",
org.eclipse.ui.forms;bundle-version="3.6.0",
org.eclipse.wst.sse.ui;bundle-version="1.3.0",
org.eclipse.jface.text;bundle-version="3.8.100",
org.eclipse.ui.workbench.texteditor;bundle-version="3.8.101",
org.eclipse.ui.views;bundle-version="3.6.0"
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-Version: 1.0.0.qualifier
I get a similar error if I remove the <repository>-tag from the pom.
Without that information Tycho does not know where to download the required packages.
Therefore you have to add the following snippet to your pom:
<repository>
<id>eclipse-indigo</id>
<url>http://download.eclipse.org/releases/indigo</url>
<layout>p2</layout>
</repository>
I copied the snippet from here, for more information look here.
Tycho reads your MANIFEST.MF and feature.xml to find the dependencies of your plugins and adds them (temporarily) to your POMs which are used by Maven to perform the build. The idea of Tycho is to maintain the dependencies solely in the MANIFEST.MF and feature.xml, freeing you from the need to add them to the POMs, too. However, you still need to add an appropriate repository, usually in the parent POM, in which the dependent plugins can be found. This is obviously missing in your POMs.

Bundle org.apache.ant could not be found. (Gradle and wuff)

I am trying to covert some existing eclipse plugin to gradle using the "wuff" plugin at
https://github.com/akhikhl/wuff/wiki/Convert-existing-Eclipse-plugins-and-apps-to-Gradle
I followed the tutorial and created the sample app successfully, but when trying to convert my own plugin i get the following error:
Bundle name org.apache.ant could not be found
The org.apache.ant is in my Require-Bundle in the Manifest.MF
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
org.eclipse.core.resources,
org.eclipse.jdt.core,
org.apache.ant