jersey icon indicating copy to clipboard operation
jersey copied to clipboard

#5384 add missing osgi capability info for spifly injection

Open col-panic opened this issue 1 year ago • 5 comments

As described in https://github.com/eclipse-ee4j/jersey/issues/5834

col-panic avatar Feb 03 '25 07:02 col-panic

@col-panic why is this needed? Section 13.3. Says:

Consumers are classes that are not OSGi aware and directly use the Service Loader API

But that is not Jersey. Jersey is OSGi-aware, see OsgiRegistry class that has OsgiServiceFinder to lookup for the services in an OSGi environment.

Jersey is using ServiceFinder class to lookup instead of using directly ServiceLocator. That has an OSGi-aware ServiceIteratorProvider at hand.

jansupol avatar Feb 04 '25 16:02 jansupol

It is tightly interconnted with https://github.com/jakartaee/rest/pull/1308 - without this patch I can't seem to connect jakarta rest requiring the services provided by jersey! Only with both patches this and the one in jakartaee/rest repo I managed to get the entire functionality up and running in my Osgi environment! Despite jersey having the functionality jakarta rest seems not to?!

Do you see another solution?

col-panic avatar Feb 04 '25 17:02 col-panic

Is it not enough to make the API OSGi-aware?

jansupol avatar Feb 04 '25 17:02 jansupol

Is it not enough to make the API OSGi-aware?

This seems to be the preferred approach to do just that. Take a look at the first post in https://github.com/eclipse-ee4j/jersey/issues/5834 - I referenced other projects realizing this compatibility just by extending the MANIFEST with the adaptations proposed in this patch.

col-panic avatar Feb 04 '25 17:02 col-panic

@col-panic We have OSGi tests in Jersey using Felix. Some magic is used there if you care to look.

The PR you created adds some code that is not covered by tests, and we do not understand it. If later someone comes saying there needs to be done something differently, we have no possibility to decide if yes or no. So we need to understand what is it you do.

jansupol avatar Feb 04 '25 17:02 jansupol