0

I'm facing a problem while trying to inject some OSGi Services into a bundle. Some bundles are failing with the following error:

2023-03-14T09:38:12,149 | ERROR | BlueprintContainerImpl         | org.apache.aries.blueprint.core | Unable to start container for blueprint bundle org.example.acc.fileProcessor.frames/1.6.0.dev-SNAPSHOT due to unresolved dependencies [(objectClass=org.example.acc.fileProcessor.api.commonUtilities.services.TailoringManagerService), (objectClass=org.example.acc.fileProcessor.api.commonUtilities.services.LoggerService), (objectClass=org.example.acc.fileProcessor.api.commonUtilities.services.ConfigurationManagerService)]

Other services are injected correctly in the same consumer, but for some reason those are not.

The weird thing is that those services implementations are currently provided by another bundle, so I don't get why they are not automatically injected. Indeed, if i run karaf:services on the bundle that should export them, I see:

    org.example.acc.fileProcessor.common (407) provides:
---------------------------------------------------------------
[org.example.acc.fileProcessor.api.commonUtilities.services.TailoringManagerService]
[org.example.acc.fileProcessor.api.commonUtilities.services.ConfigurationManagerService]
[org.example.acc.fileProcessor.api.commonUtilities.services.LoggerService]
[org.example.acc.fileProcessor.api.commonUtilities.services.ManifestFileManagerService]
[org.osgi.service.blueprint.container.BlueprintContainer]

The maven-bundle-plugin configuration is the following:

<plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <extensions>true</extensions>
                <configuration>
                    <instructions>
                        <_removeheaders>Import-Service,Export-Service</_removeheaders>
                        <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
                        <Import-Package>*</Import-Package>
                        <Export-Package>${project.artifactId}.*</Export-Package>
                    </instructions>
                </configuration>
            </plugin>

Is there any reason for this to happen?

Bambatrack
  • 51
  • 4
  • If you're using blueprints you could try blueprint reference tricks described [here](https://stackoverflow.com/a/10795778/16480631). – Pasi Österman Mar 15 '23 at 16:59

0 Answers0