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

angus activation does not provide its services in an OSGi environment #35

Closed
mnlipp opened this issue Apr 24, 2023 · 1 comment · Fixed by #36
Closed

angus activation does not provide its services in an OSGi environment #35

mnlipp opened this issue Apr 24, 2023 · 1 comment · Fixed by #36

Comments

@mnlipp
Copy link
Contributor

mnlipp commented Apr 24, 2023

Angus activation provides an implementation of the Jakarta Activation Specification. The relationship between the jar providing the API and its implementation is established at runtime using the service discovery mechanism. This has been implemented correctly for non-OSGI environments by adding the files META-INF/services/jakarta.activation.spi.MimeTypeRegistryProvider and osgi.serviceloader=jakarta.activation.spi.MailcapRegistryProvider to the jar.

Due to OSGi's classpath isolation, service discovery requires additional information in MANIFEST.MF. The jakarta.activation-api has correctly added this information (Require-Capability header referencing the interfaces enumerated above). Angus activation should have the corresponding (matching) Provide-Capability header, but it does not.

The buggy information provided in angus-activation's Provide-Capability header is:

osgi.serviceloader;osgi.serviceloader="org.eclipse.angus.activation.MailcapRegistryProviderImpl";register:="org.eclipse.angus.activation.MailcapRegistryProviderImpl"
osgi.serviceloader;osgi.serviceloader="org.eclipse.angus.activation.MimeTypeRegistryProviderImpl";register:="org.eclipse.angus.activation.MimeTypeRegistryProviderImpl"

The name after osgi.serviceloader= must be the type of the service provided (i.e. it must match the file name used in META-INF/services/). The name after register:= must be the implementation class (i.e. the content of the file in in META-INF/services/). (The latter information is provided correctly, but could be omitted).

The bug is present in both 1.X and 2.X.

lukasj added a commit to lukasj/angus-activation that referenced this issue Apr 25, 2023
…n OSGi environment

Signed-off-by: Lukas Jungmann <lukas.jungmann@oracle.com>
@lukasj
Copy link
Member

lukasj commented Apr 25, 2023

can you can #36 is the right fix for this, please?

lukasj added a commit that referenced this issue Apr 25, 2023
…onment

Signed-off-by: Lukas Jungmann <lukas.jungmann@oracle.com>
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

Successfully merging a pull request may close this issue.

2 participants