1

I have a server side OSGi application, running in an equinox container. This application uses the org.apache.felix.webconsole (4.6.2) and other bundles. These other bundles need javax.http > 4.0.0 which I provide with the jakarta.servlet-api (4.0.0). org.apache.felix.webconsole needs javax.servlet=[2.4.0,4.0.0) which I provide with the bundle javax.servlet-api (3.1.0).

When I start the application, the OSGi runtime complains with the a BundleException: Could not resolve module: org.apache.felix.webconsole / Unresolved requirement: Import-Package: javax.servlet; version="[2.4.0,4.0.0)"

What can I do to fix this problem?

2
  • Please check that you actually have servlet-api 3 and 4 bundles installed. It looks like the version 3 is missing. Other than that be aware that usually you not only want an api but also an implementation. In many cases in OSGi the bundle that provides the implementation also provides the api. Also check the Manifest of the api bundles. In OSGi the important part is not the bundle version but rather that package exports in the Manifest. Commented Jun 22, 2021 at 9:25
  • I guess, the hint concerning the difference between api and implementation is correct. After adding a bundle that provides the implementation, the error message went away. Commented Jul 5, 2021 at 14:12

1 Answer 1

0

From the Error I can get to know, OGSI Expects javax-servlet version greater than 2.4.0 So you can check with this dependency in your pom.xml

<dependency>
   <groupId>javax.servlet</groupId>
    <artifactId>javax.servlet-api</artifactId>
    <version>3.1.0</version>
 </dependency>
Sign up to request clarification or add additional context in comments.

1 Comment

I'm using pomless build with Tycho, so this is not a solution in my case.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.