Cannot satisfy dependency in STS4 org.springframework.boot.ide.branding.sts4 4.12.0 - spring-tools-4

It is not possible to install org.springframework.boot.ide.branding.sts4 4.12.0 in eclipse 2021-09.
The only message in the logs is "no remedy found".
Cannot complete the install because of a conflicting dependency.
Software being installed: Spring Tool Suite 4 4.12.0.202109130803 (org.springframework.boot.ide.branding.sts4 4.12.0.202109130803)
Software currently installed: Equinox p2, Provisioning for IDEs. 2.4.1300.v20210830-0925 (org.eclipse.equinox.p2.user.ui.feature.group 2.4.1300.v20210830-0925)
Only one of the following can be installed at once:
Equinox Java Authentication and Authorization Service (JAAS) 1.3.700.v20210726-0943 (org.eclipse.equinox.security 1.3.700.v20210726-0943)
Equinox Java Authentication and Authorization Service (JAAS) 1.3.600.v20210126-1005 (org.eclipse.equinox.security 1.3.600.v20210126-1005)
Cannot satisfy dependency:
From: Equinox p2, headless functionalities 1.6.1100.v20210830-0925 (org.eclipse.equinox.p2.core.feature.feature.group 1.6.1100.v20210830-0925)
To: org.eclipse.equinox.p2.iu; org.eclipse.equinox.security [1.3.700.v20210726-0943,1.3.700.v20210726-0943]
Cannot satisfy dependency:
From: Equinox p2, Provisioning for IDEs. 2.4.1300.v20210830-0925 (org.eclipse.equinox.p2.user.ui.feature.group 2.4.1300.v20210830-0925)
To: org.eclipse.equinox.p2.iu; org.eclipse.equinox.p2.core.feature.feature.group [1.6.1100.v20210830-0925,1.6.1100.v20210830-0925]
Cannot satisfy dependency:
From: Eclipse Platform 4.20.0.v20210611-1600 (org.eclipse.platform.feature.group 4.20.0.v20210611-1600)
To: org.eclipse.equinox.p2.iu; org.eclipse.equinox.security [1.3.600.v20210126-1005,1.3.600.v20210126-1005]
Cannot satisfy dependency:
From: Spring Tool Suite 4 4.12.0.202109130803 (org.springframework.boot.ide.branding.sts4 4.12.0.202109130803)
To: org.eclipse.equinox.p2.iu; org.eclipse.platform.feature.group [4.20.0.v20210611-1600,4.20.0.v20210611-1600]
Any suggestions?

The branding feature is nothing that you should install into an existing Eclipse installation. It provides the product branding for the Spring Tools 4 distribution and does not provide any functionality beyond that.
If you want to install the Spring Tools 4 into an existing Eclipse installation, you can:
use the Eclipse Marketplace entry for Spring Tools 4
or install from the p2 repository by selecting the features you want to instal manually (as described here: https://github.com/spring-projects/sts4/wiki/Installation#install-spring-tools-4-into-an-existing-eclipse-via-a-p2-repo)
Another way would be to download the ready-to-use distribution from https://spring.io/tools, which comes with the latest Eclipse release included and Spring Tools 4 pre-installed.

Related

Added dependency in Gradle, Liferay says "Unresolved requirement: Import-Package"

I wrote a Liferay module and deployed it successfully.
Then I added this line in build.gradle's dependencies section:
compileOnly group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.5.3'
After running ./gradlew eclipse I can use the library with no problem in Eclipse. But deployment fails:
12:29:35,454 WARN [fileinstall-/home/nico/liferay/osgi/modules][org_apache_felix_fileinstall:103] Error while starting bundle: file:/home/nico/liferay-dxp-digital-enterprise-7.0-sp3/osgi/modules/de.nico.mymodule-1.0.0.jar
org.osgi.framework.BundleException: Could not resolve module: de.nico.mymodule [1085]_ Unresolved requirement: Import-Package: org.apache.http; version="4.5.3"_ [Sanitized]
at org.eclipse.osgi.container.Module.start(Module.java:429)
at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:402)
at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundle(DirectoryWatcher.java:1253)
at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(DirectoryWatcher.java:1225)
at org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:512)
at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:361)
at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:312)
I have no idea why it is looking for org.apache.http and not org.apache.httpcomponents.
Here is my bnd.bnd:
Bundle-SymbolicName: de.nico.mymodule
Bundle-Version: 1.0.0
Liferay-Require-SchemaVersion: 1.0.0
How to investigate this problem?
I don't want to download/add the JAR manually.
In your bnd.bnd
add this code ..
Import-Package:\
!org.apache.*,\
\
*
the further investigations will start at the exception messsage. It says that the following requirement is not present at RUNTIME:
Import-Package: org.apache.http; version="4.5.3"
I'm assuming that it's one of the following:
you didn't deploy the httpcomponents (or a version you need .. see Semantic Versioning) libraries to Liferay (as compile works, while deployment fails)
httpcomponents might not be packaged as OSGi bundles. In that case you'll have to decide how to make the code available. Good starting points for more information are the official docs (thanks Andrea, promoting this from the comments) and David Nebinger's blog article
How you add those dependencies to Liferay's runtime is up to you. If the dependencies are OSGi bundles, you can download&deploy them directly. If they're no OSGi bundles, follow one of the techniques described in the linked articles.

What is the point of a features.xml if I have to install the bundles in it manually?

I have a features.xml with a few bundles listed. But they all need to be installed apparently. So all that the features.xml does is gather the dependencies in one spot....
Unless I am horribly mistaken. In which case how does one resolve a situation where I have a lot of dependencies in features.xml and they are all not in any order. Right now I am going through the exercise of installing each bundle and starting them up one by one...
Tell me what I am doing wrong- of which there may be several things
Edit:
Features were generated by maven plugin.
When I install feature, I get unresolved error
Error executing command: Unable to resolve root: missing requirement [root] osgi.identity; osgi.identity=myBundleApp; type=karaf.feature; version="[1.0.0.RC1,1.0.0.RC1]"; filter:="(&(osgi.identity=myBundleApp)(type=karaf.feature)(version>=1.0.0.RC1)(version<=1.0.0.RC1))" [caused by: Unable to resolve myBundleApp/1.0.0.RC1: missing requirement [myBundleApp/1.0.0.RC1] osgi.identity; osgi.identity=org.eclipse.jetty.websocket.server; type=osgi.bundle; version="[9.3.6.v20151106,9.3.6.v20151106]"; resolution:=mandatory [caused by: Unable to resolve org.eclipse.jetty.websocket.server/9.3.6.v20151106: missing requirement [org.eclipse.jetty.websocket.server/9.3.6.v20151106] osgi.extender; filter:="(osgi.extender=osgi.serviceloader.registrar)"]]
But the feature.xml already has <bundle>mvn:org.eclipse.jetty.websocket/websocket-server/9.3.6.v20151106</bundle>
The point of features.xml is to define a repository of features that can be used to provision an OSGi application in Apache Karaf. In another words, it's purpose is exactly to NOT have to install bundles manually! As documentation states:
When you install a feature, Apache Karaf installs all resources described in the feature. It means that it will automatically resolves and installs all bundles, configurations, and dependency features described in the feature.
That said, please keep in mind:
this is Karaf specific functionality. It will not work with other OSGi containers
before you can install a feature you need to make Karaf aware of the repository containing it. You can use feature:repo-list command to check what repos Karaf is aware of and feature:repo-add command to add repositories. Please see this documentation for more details.
URLs pointing to bundles, features, configurations, ... inside features.xml have to point to a reasoures Karaf understands and can access
Features (much like bundles) need to be resolved before they be activated.

SonarQube plugin unable to install in RAD 9.0

I installed SonarQube plugin in RAD 9.0 from http://downloads.sonarsource.com/eclipse/eclipse/
(Help > Install New Software > Added SonarQube Integration for Eclipse (update-site) - http://downloads.sonarsource.com/eclipse/eclipse/
Selected SonarQube Eclipse Integration and SonarQube Java Configuration helper)
Cannot complete the install because one or more required items could not be found.
Software being installed: SonarQube Integration for Eclipse 3.5.0.20150804-1512-RELEASE (org.sonar.ide.eclipse.feature.feature.group 3.5.0.20150804-1512-RELEASE)
Missing requirement: Apache Apache HttpClient OSGi bundle 4.3.2 (org.apache.httpcomponents.httpclient 4.3.2) requires 'package org.apache.commons.logging [1.1.0,1.2.0)' but it could not be found
Cannot satisfy dependency:
From: SonarQube Integration for Eclipse 3.5.0.20150804-1512-RELEASE (org.sonar.ide.eclipse.feature.feature.group 3.5.0.20150804-1512-RELEASE)
To: org.apache.httpcomponents.httpclient [4.3.2]
Can any one please suggest whats missing here

Felix bundles failng to load

I am attempting to run an application on Apache Felix, using the Felix Dependency bundles. The container is, for some reason, not loading my bundles.
I am doing my development using Bndtools in Eclipse. I am using the Amdatu bundles.
The bundles I am concerned about are the bundles that are in my "Run Requirements":
org.apache.felix.dependencymanager
org.apache.felix.dependencymanager.shell
org.apache.felix.dependencymanager.runtime
osgi.core
osgi.cmpn
All of the above bundles are taken from the Amdatu repository.
I have two bundles which I created:
com.test.demo.reader
com.test.demo.listener
And these bundles are built using org.apache.felix.dependencymanager and osgi.core.
When I attempt to run OSGi, I am getting the following failures:
! could not resolve the bundles: [com.test.demo.reader-1.0.0 Unresolved constraint in bundle
com.test.demo.reader [8]: Unable to resolve 8.0: missing requirement
[8.0] osgi.wiring.package; (&(osgi.wiring.package=org.apache.felix.dm)(version>=3.0.0)(!(version>=4.0.0))),
com.test.demo.listener-1.0.0 Unresolved constraint in bundle com.test.demo.listener [9]:
Unable to resolve 9.0: missing requirement [9.0] osgi.wiring.package;
(&(osgi.wiring.package=com.test.demo.reader)(version>=1.0.0)(!(version>=2.0.0)))
[caused by: Unable to resolve 8.0: missing requirement [8.0] osgi.wiring.package;
(&(osgi.wiring.package=org.apache.felix.dm)(version>=3.0.0)(!(version>=4.0.0)))]]
and
! Failed to start bundle com.test.demo.reader-1.0.0, exception Unresolved constraint in
bundle com.test.demo.reader [8]: Unable to resolve 8.0: missing requirement [8.0]
osgi.wiring.package; (&(osgi.wiring.package=org.apache.felix.dm)(version>=3.0.0)
(!(version>=4.0.0)))
and more
! Failed to start bundle com.test.demo.listener-1.0.0, exception Unresolved constraint in
bundle com.test.demo.listener [9]: Unable to resolve 9.0:
missing requirement [9.0] osgi.wiring.package; (&(osgi.wiring.package=com.test.demo.reader)
(version>=1.0.0)(!(version>=2.0.0))) [caused by: Unable to resolve 8.0: missing requirement
[8.0] osgi.wiring.package; (&(osgi.wiring.package=org.apache.felix.dm)(version>=3.0.0)
(!(version>=4.0.0)))]
I think I understand what is happening: apparently the org.apache.dm package being used is a version that is somehow incompatible with my bundles. But that doesn't make any sense, because according to the Felix documentation the org.apache.dm package is in the org.apache.felix.dependencymanager bundle. That bundle is from the Amdatu repository and it is the only version of the bundle I am using with my application! How is the version incompatible with my bundles when theirs is the only version that my bundles know about???
Someone please advise. What is causing this failure an how can I fix it?
The problem was the runtime I was running and what appears to be a bug in the Amdatu plugin.
I would not advise using the Amdatu configuration in your OSGi project. Not in its current form.
The various Felix Dependency bundles that I have been using from Amdatu are apparently intended to run under Felix version 5. Unfortunately, the Amdatu environment (the "Amdatu Configuration" that you can select when you choose a configuration template for your project) does not load Version 5. When you select the "Bundle- Hub configuration", your choice of runtime environments includes all Felix environments from Version 4.0.2 to Version 5.2, as well as several versions of Equinox. When you select the "Amdatu Configuration" you only runtime choices are Felix 4.0.2 and Felix 4.2.0.
I was using 4.2.0 Felix, and as a result the dependency bundles were not working.
The Amdatu environment in its current form is unusable in Bndtools. It apparently supplies the right bundles for Version 5 but does not provide that environment for the user.
I did try manually changing the runtime environment io Version 5.2. This did not work because apparently when you select a template, Bndtools puts together whatever runtimes are associated with the template. Because the Amdatu template does not include Felix version 5, the runtime environment is unavailable.
In order to get my application to run, I had to create a new project that used the "Bundle- Hub" template and manually download the dependency bundles from the Felix website and include them in my buil and runtime environments. Unfortunately, neither Bndtools nor Amdatu provides any way to add the Amdatu bundles to project after a template is selected. This means that instead of using the ready- made bundles from Amdatu, you have to go out to the source sites and manually include them.
I will probably ty and find a way to create a new repository that can be included in projects and contains all the Amdatu bundles, then include that repository in the "Bundle- Hub" template. I will also report the problems with environments (as well as seversl other problems I've seen) to the Amdatu folks.
In the meantime, my application runs smoothly now that I have set up the right runtime environment.
Special thanks to earcam, whose questions in the comment above gave me a clue as to what to start looking at to solve this problem...

Karaf development

Im currently develop bundles for karaf and have some questions...
I wrote a bundle/webservice based on cxf, I try to deploy it in karaf but it could not start that bundle because it could not resolve some packages e.g.
org.osgi.framework.BundleException: Unresolved constraint in bundle org.springframework.aop [56]: Unable to resolve 56.0: missing
requirement [56.0] package; (&(package=org.aopalliance.aop)(version>=1.0.0)(!(version>=2.0.0)))
so here is a question, this package dependency comes from spring-aop (3.1.0.RELEASE), so where is the problem? what dependency is missing? how can I solve such problems?
In that case i did not clearly understand the development process. should i deploy all missing bundles in deploy? because i would like to keep thirdparty libs spereated from my developed bundles. And what bundles i have to deploy? Is it a trial and error process? Is there a common way to let maven do the dependency stuff?
I discovered a folder "system" and read on the docu that it is a repository like maven, is it for the features?
I had for test cases a karaf with some pre deployed bundles and put my webservice bundle into it, but again execeptions...
Caused by: java.lang.ClassNotFoundException: javax.servlet.http.HttpServlet
What dependency is missing?
I already read the tutorial about camel and karaf, but it did not explain the deployment stuff, so could anyone suggest me a good tutorial?
Thanks!
Chris
Short answer
Scroll down to the bit referring to "camel-cxf" and run the two commands features:addurl and features:install. I have a feeling this will resolve all your problems.
spring-aop
On Karaf console type:
exports | grep org.aopalliance.aop
I think you'll see lines like:
XX org.aopalliance.aop; version=3.1.0.RELEASE
So while the spring-aop bundle has the right packages they're the wrong version, the range being requested is >=1.0.0 and <2.0.0, so 3.1.0 doesn't satisfy that.
Deploying/Installing
You can drop bundles into ${karaf.home}/deploy or use the console.
You can install maven bundles from the Karaf console with:
install -s mvn:groupId/artifactId/version/packaging/classifier
Where -s starts the bundle and packaging/classifier are optional.
You can find a lot of OSGi ready maven dependencies here http://ebr.springsource.com/repository/app/ - I had a quick look but your spring aop dependency is very old, what version of CXF are you using?
Read up about Karaf features - they're basically XML files that list suites of bundles that can be installed. Very useful for deploying large numbers of bundles and they can be installed into a maven repository.
There are some standard features available in Karaf, try:
features:install war
This will give you a jetty webcontainer and may resolve your ClassNotFoundException: javax.servlet.http.HttpServlet as long as it's the right version
Camel also has a features file which probably sort all your issues, try this:
features:addurl mvn:org.apache.camel.karaf/apache-camel/2.9.0/xml/features
features:install camel-cxf
Tutorials
There's quite a bit available, some on http://karaf.apache.org and http://fusesource.com but also take a look at the PDF manual that comes in the Karaf distribution.
Always beware that info may be out-of-date
Please post your MANIFEST.MF file. I think you didn't not mention the tag in maven-bundle-plugin dependency.

Resources