Skip to content

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

@mnlipp

Description

@mnlipp

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions