Hi @MateuszNo2,
When the same package is declared in both Export-Package and Import-Package of your OSGi bundle's bnd configuration, it creates a conflict between the bundle acting as a provider and simultaneously a consumer of that package.
Here is what happens:
-
OSGi will prefer the imported version if the same package is available from another bundle.
-
This may cause version mismatches, especially if the imported version differs from the local (exported) one.
-
It can also result in split packages, where classes from the same package are loaded by different classloaders, leading to ClassCastException, NoClassDefFoundError, or unexpected behavior.
Please refer below link for more details: https://techinnovia.com/package-import-and-export/
Santosh Sai

