Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing bundle-version in Fragment-Host for pax-web-compatibility-servlet31 #2005

Open
philippberger opened this issue Dec 18, 2024 · 7 comments

Comments

@philippberger
Copy link

In the bundle headers of pax-web-compatibility-servlet31 the bundle-version is not set to Fragment-Host jakarta.servlet-api. If multiple versions of jakarta.servlet-api are deployed the wrong bundle could be picked.

Therefore the Fragment-Host should be changed from
Fragment-Host: jakarta.servlet-api
to
Fragment-Host: jakarta.servlet-api;bundle-version="[4,5)"

@grgrzybek
Copy link
Member

If multiple versions of jakarta.servlet-api are deployed

When using Pax Web I did some (very few) assumptions and one of them is to have single Servlet API bundle - and for version 3 - only this single compatibility fragment.
If you have multiple Servlet API bundles within single OSGi runtime, it's like asking for trouble... Is it possible to ensure that only one such bundle is installed?

In Karaf for example you can blacklist some bundles from any features using etc/org.apache.karaf.features.xml file...

@philippberger
Copy link
Author

Is it possible to ensure that only one such bundle is installed?

As we need to make use of org.apache.felix.http.wrappers which requires both version, we cannot ensure to only have one bundle.

@grgrzybek
Copy link
Member

Is it possible to ensure that only one such bundle is installed?

As we need to make use of org.apache.felix.http.wrappers which requires both version, we cannot ensure to only have one bundle.

Hmm, at class level - any Servlet API jar (whatever's its symbolic name) provides the same classes, so I don't think you need more jars with the same classes...

You can also prepare another compatibility bundle or - if you don't use pax-web-jetty - you don't need this bundle at all.

@philippberger
Copy link
Author

Hmm, at class level - any Servlet API jar (whatever's its symbolic name) provides the same classes, so I don't think you need more jars with the same classes...

Please compare mvn:jakarta.servlet/jakarta.servlet-api/4.0.4 and mvn:jakarta.servlet/jakarta.servlet-api/6.1.0.
These bundles do not provide the same classes

@grgrzybek
Copy link
Member

ah, got it - these are different APIs - I was thinking that it's uncommon to use both javax.servlet and jakarta.servlet (JakartaEE 9+), but nothing's impossible with OSGi ;)

After holidays I'll run the tests and prepare new release, ok?

@philippberger
Copy link
Author

@grgrzybek did you find time to run some tests already?

@grgrzybek
Copy link
Member

Not yet, but I'll mark this issue (mentally) as more important - please give me some time...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants