I want to use log4j2 in my osgi-bundle for karaf. When i add log4j into the
pom, compile it and load it into karaf, then the exception
Unresolved requirements: [[... [56](R 56.0)] osgi.wiring.package;
(&(osgi.wiring.package=*org.apache.logging.log4j*)(version>=2.11.0)(!(version>=3.0.0)))]
is thrown. This must be, because i not added something to
maven-bundle-plugin. Bot when i add there
<Private-Package>..., org.apache.logging.log4j*</Private-Package> or
<Private-Package>..., *</Private-Package>
i get the exception
Unresolved requirements: [[... [57](R 57.0)] osgi.wiring.package;
(osgi.wiring.package=*com.conversantmedia.util.concurrent*)]
Looking for the package gets me to adding
<dependency>
<groupId>com.conversantmedia</groupId>
<artifactId>disruptor</artifactId>
<version>1.2.0</version>
</dependency>
to the pom. Now i get
Unresolved requirements: [[... [58](R 58.0)] osgi.wiring.package;
(osgi.wiring.package=*com.fasterxml.jackson.annotation*)]
Is it necessary that i add all depended libraries for log4j manually to the
pom to get a working bundle? Or is there a better way?
I am new to osgi and karaf. How can i add log4j accurate in a osgi-bundle,
so its log is shown in karaf log:display?
Regards,
Matthias
--
Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html