mail-api icon indicating copy to clipboard operation
mail-api copied to clipboard

The hk2 service loader is not used everywhere (where necessary)

Open mnlipp opened this issue 3 years ago • 2 comments

Describe the bug

Currently, the hk2 service locator is used in FactoryFinder only. Session.java uses the ServiceLoader without the hk2 "wrapper" and therefore fails to load the providers in an OSGi environment.

mnlipp avatar Nov 02 '22 15:11 mnlipp

@mnlipp this was merged: https://github.com/jakartaee/mail-api/pull/633

Can we close this?

jbescos avatar Nov 08 '22 05:11 jbescos

Can we close this?

No. #633 was about introducing the OSGi service mediator. Now, if you don't have this in place, the fallback is to use the hk2 service locator. Hk2 requires special coding for looking up the services. This special coding is currently only provided in FactoryFinder. It's missing in Session.java. Therefore providers are not found in an OSGi environment.

mnlipp avatar Nov 08 '22 07:11 mnlipp