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

load slf4j 2.0.x Exceptions in OSGI , the version number and check mode are incorrect. #412

Open
yuhJohn opened this issue Apr 13, 2024 · 0 comments

Comments

@yuhJohn
Copy link

yuhJohn commented Apr 13, 2024

Failed to load slf4j-api in the OSIG environment.

ERROR log :
Unresolved requirement: Import-Package: org.slf4j
-> Export-Package: org.slf4j; bundle-symbolic-name="slf4j.api"; bundle-version="2.0.12"; version="1.7.36"
slf4j.api [9]
Unresolved requirement: Require-Capability: osgi.extender; filter:="(&(osgi.extender=osgi.serviceloader.processor)(version>=1.0.0)(!(version>=2.0.0)))"
Unresolved requirement: Import-Package: org.slf4j.helpers
-> Export-Package: org.slf4j.helpers; bundle-symbolic-name="slf4j.api"; bundle-version="2.0.12"; version="1.7.36"

in parent pom.xml slf4j-master/slf4j-master/parent/pom.xml
<latest.1.version>1.7.36</latest.1.version>

in slf4j-api pom.xml

<plugin>
       <groupId>org.apache.felix</groupId>
       <artifactId>maven-bundle-plugin</artifactId>
       <configuration>
         <instructions>
           <Import-Package>org.slf4j.spi;version="${range;[===,+);${version_cleanup;${project.version}}}"</Import-Package>
           <!-- Export the client/user package of slf4j-api version 1 to make the slf4j-api bundle in version 2 usable for bundles that only import slf4j-1.x -->
           <_exportcontents><![CDATA[
             *,\
             **org.slf4j;version="${latest.1.version}",\
             org.slf4j.helpers;version="${latest.1.version}"**
           ]]></_exportcontents>
           <Require-Capability><![CDATA[
             **osgi.extender;filter:="(&(osgi.extender=osgi.serviceloader.processor)(version>=1.0.0)(!(version>=2.0.0)))",**
             osgi.serviceloader;filter:="(osgi.serviceloader=org.slf4j.spi.SLF4JServiceProvider)";osgi.serviceloader="org.slf4j.spi.SLF4JServiceProvider"
           ]]></Require-Capability>
         </instructions>
       </configuration>
     </plugin>

Please help to check the verification logic of the version number and filter.
Thanks

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

No branches or pull requests

1 participant