Hi Andrei, I guess you already found a solution for the issue you're observing. Anyway, once you start using Pax Logging in an OSGi container, you should abandon using the original libraries from the logging framework of your choice in this container. Of course these original libraries might be OSGi compliant. However, Pax Logging API priovides the same (or similiar :) ) set of packages/classes as the chosen logging framework and the version of these exported packages is also often the same. Pax Logging does not export impl classes for given logging APIs. This might cause logging frameworks to malfunction.
... so you should use either: Pax Logging API + PAX Logging Service or SLF4J API and a chosen SLF4J impl. If you choose to use Pax Logging in the OSGi container instead of real SLF4J and you need to execute unit tests (tests run outside of the OSGi container), you will probably use real org.slf4j/slf4j-api and one of the slf4j impls and not Pax Logging in these tests. Oh, to reset your password go to http://sso.ops4j.org. Best regards, Bartek 2011/4/24 Andrei Pozolotin <[email protected]>: > you mean in "org.slf4j.impl"? - I use none; > > but slf4j-api expects to find it: > (bundles both from http://www.slf4j.org/download.html & > http://ebr.springsource.com/repository/app/bundle/version/detail?name=com.springsource.slf4j.api&version=1.6.1&searchType=bundlesByName&searchQuery=slf4j > ) > > look: > http://www.slf4j.org/codes.html#StaticLoggerBinder > ################## > > Failed to load class org.slf4j.impl.StaticLoggerBinder > > This error is reported when the org.slf4j.impl.StaticLoggerBinder class > could not be loaded into memory. This happens when no appropriate SLF4J > binding could be found on the class path. Placing one (and only one) of > slf4j-nop.jar, slf4j-simple.jar, slf4j-log4j12.jar, slf4j-jdk14.jar or > logback-classic.jar on the class path should solve the problem. > > As of SLF4J version 1.6, in the absence of a binding, SLF4J will default to > a no-operation (NOP) logger implementation. > > ################## > > > > -------- Original Message -------- > Subject: Re: bundles fail to start --- > http://wiki.ops4j.org/display/paxlogging/2011/02/23/Pax+Logging+1.6.1+released > From: Guillaume Nodet <[email protected]> > To: Andrei Pozolotin <[email protected]> > Cc: General OPS4J <[email protected]> > Date: Sun 24 Apr 2011 01:38:33 AM CDT > > What classes do you use in this package? > > On Saturday, April 23, 2011, Andrei Pozolotin > <[email protected]> wrote: > > > > > > > Guillaume: > > > 1) thanks for the answer; > my current workaround is to mark slf4j-api maven dependency as optional; > > > 2) re: " > The org.slf4j.impl is not exported because it's not an API. Nobody is > supposed to use that directly. If you control the code, you can > simply remote the references to those. > Else, it may be a bit more complicated depending on how that's use. > > " > I am still not convinced; > > for example, if you take a look here: > http://ebr.springsource.com/repository/app/bundle/version/detail?name=com.springsource.slf4j.api&version=1.6.1&searchType=bundlesByName&searchQuery=slf4j > > it is still required (presumably spring people know what they are doing > :-) ) > > > > Package Name > Version Range > Optional? > > > org.slf4j.impl > [1.6.1, 2.0.0) > false > > > > > > 3) probably a better way to handle this in pax-logging would be: > > a) kill your org.ops4j.pax.logging.pax-logging-api_1.6.1.jar bundle > > b) let people use "normal" logging api bundle dependencies like this: > <dependency> > <groupId>org.slf4j</groupId> > <artifactId>com.springsource.slf4j.api</artifactId> > <version>1.6.1</version> > </dependency> > > c) export "org.slf4j.impl" and similar packages from your > org.ops4j.pax.logging.pax-logging-service_1.6.1.jar > and activate support for a particular logging front end only when > corresponding logging api is detected on the framework; > > Thank you, > > > Andrei > > > > > -------- Original Message -------- > Subject: Re: bundles fail to start --- > http://wiki.ops4j.org/display/paxlogging/2011/02/23/Pax+Logging+1.6.1+released > From: Guillaume Nodet <[email protected]> <[email protected]> > To: General OPS4J <[email protected]> <[email protected]> > Cc: Andrei Pozolotin > <[email protected]> <[email protected]> > Date: Fri 22 Apr 2011 03:29:22 PM CDT > > You should use [email protected], so cc there > The org.slf4j.impl is not exported because it's not an API. Nobody is > supposed to use that directly. If you control the code, you can > simply remote the references to those. > Else, it may be a bit more complicated depending on how that's use. > > On Fri, Apr 22, 2011 at 21:55, Andrei Pozolotin > <[email protected]> <[email protected]> wrote: > > > Guillaume, hello; > > 1) thanks for the release: > http://wiki.ops4j.org/display/paxlogging/2011/02/23/Pax+Logging+1.6.1+released > > 2) I am using slf4j in my bundles: > <dependency> > <groupId>org.slf4j</groupId> > <artifactId>slf4j-api</artifactId> > <version>1.6.1</version> > </dependency> > > 3) which comes as an osgi bundle from maven central: > http://search.maven.org/#artifactdetails|org.slf4j|slf4j-api|1.6.1|jar > > 4) and declares this import: > Import-Package: org.slf4j.impl;version=1.6.0 > > 5) which is NOT exported by either of: > org.ops4j.pax.logging.pax-logging-api_1.6.1.jar > org.ops4j.pax.logging.pax-logging-service_1.6.1.jar > (see below) > > 6) therefore my bundles fail to start; > can you please let me know what am I missing? > > 7) sorry I could not file this on ops4j jira since > I do have account, but forgot password, and you do not provide > pass reset feature there; > > Thank you, > > Andrei > > > ###################################################### > > org.ops4j.pax.logging.pax-logging-api_1.6.1.jar > > > Manifest-Version: 1.0 > Export-Package: org.apache.avalon.framework.logger;provider=paxlogging > ;uses:="org.apache.log";version="4.3",org.apache.commons.logging;prov > ider=paxlogging;uses:="org.ops4j.pax.logging,org.osgi.framework";vers > ion="1.1.1",org.apache.commons.logging;version="1.0.4";provider=paxlo > gging,org.apache.commons.logging.impl;provider=paxlogging;uses:="org. > apache.commons.logging";version="1.1.1",org.apache.commons.logging.im > pl;version="1.0.4";provider=paxlogging,org.apache.juli.logging;provid > er=paxlogging;uses:="org.ops4j.pax.logging,org.osgi.framework";versio > n="1.0",org.apache.log4j;provider=paxlogging;uses:="org.ops4j.pax.log > ging,org.osgi.framework,org.apache.log4j.spi";version="1.2.15",org.ap > ache.log4j.spi;provider=paxlogging;uses:="org.apache.log4j";version=" > 1.2.15",org.apache.log4j.xml;provider=paxlogging;uses:="javax.xml.par > sers,org.w3c.dom";version="1.2.15",org.knopflerfish.service.log;provi > der=paxlogging;uses:="org.osgi.service.log,org.osgi.framework";versio > n="1.1.0",org.ops4j.pax.logging;provider=paxlogging;uses:="org.osgi.s > ervice.log,org.osgi.framework,org.osgi.util.tracker,org.knopflerfish. > service.log";version="1.6.1",org.ops4j.pax.logging.avalon;provider=pa > xlogging;uses:="org.ops4j.pax.logging,org.osgi.framework,org.apache.a > valon.framework.logger";version="1.6.1",org.ops4j.pax.logging.slf4j;p > rovider=paxlogging;uses:="org.ops4j.pax.logging,org.slf4j.helpers,org > .slf4j,org.osgi.framework,org.slf4j.spi";version="1.6.1",org.osgi.ser > vice.log;uses:="org.osgi.framework";version="1.3",org.slf4j;provider= > paxlogging;uses:="org.slf4j.helpers,org.slf4j.spi";version="1.6.1",or > g.slf4j;version="1.5.11";provider=paxlogging,org.slf4j;version="1.4.3 > ";provider=paxlogging,org.slf4j.helpers;provider=paxlogging;uses:="or > g.slf4j.spi,org.slf4j";version="1.6.1",org.slf4j.helpers;version="1.5 > .11";provider=paxlogging,org.slf4j.helpers;version="1.4.3";provider=p > axlogging,org.slf4j.spi;provider=paxlogging;uses:="org.slf4j";version > ="1.6.1",org.slf4j.spi;version="1.5.11";provider=paxlogging,org.slf4j > .spi;version="1.4.3";provider=paxlogging > Built-By: gnodet > Tool: Bnd-0.0.357 > Bundle-Name: OPS4J Pax Logging - API > Created-By: Apache Maven Bundle Plugin > Bundle-Vendor: OPS4J - Open Participation Software for Java > Build-Jdk: 1.6.0_22 > Bundle-Version: 1.6.1 > Bnd-LastModified: 1298446855820 > Bundle-Activator: org.ops4j.pax.logging.internal.Activator > Bundle-ManifestVersion: 2 > Bundle-Description: The Pax Logging API Library is to allow for the Pa > x Logging Service to be reloaded without stopping the many depende > nt bundles. It also contains the OSGi Log Service API and the Knopfle > rfish Log API. > Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.html > Bundle-DocURL: http://www.ops4j.org/projects/pax/logging/pax-logging-a > pi > Bundle-SymbolicName: org.ops4j.pax.logging.pax-logging-api > Import-Package: javax.xml.parsers,org.apache.log;resolution:=optional, > org.ops4j.pax.logging;provider=paxlogging;version="[0.9.5,2.0.0)",org > .ops4j.pax.logging.avalon;provider=paxlogging;version="[0.9.5,2.0.0)" > ,org.osgi.framework;version="[1.0.0,2.0.0)",org.osgi.service.event;re > solution:=optional;version="[1.0.0,2.0.0)",org.osgi.service.log;versi > on="[1.3.0,2.0.0)",org.osgi.util.tracker;version="[1.0.0,2.0.0)",org. > w3c.dom > > > > ###################################################### > > > org.ops4j.pax.logging.pax-logging-service_1.6.1.jar > > > Manifest-Version: 1.0 > Export-Package: org.ops4j.pax.logging.spi;provider=paxlogging;version= > "1.6.1" > Built-By: gnodet > Tool: Bnd-0.0.357 > Bundle-Name: OPS4J Pax Logging - Service > Created-By: Apache Maven Bundle Plugin > Bundle-Vendor: OPS4J - Open Participation Software for Java > Build-Jdk: 1.6.0_22 > Bundle-Version: 1.6.1 > Bnd-LastModified: 1298446880527 > Bundle-Activator: org.ops4j.pax.logging.service.internal.Activator > Bundle-ManifestVersion: 2 > Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.html > Bundle-Description: Pax Logging Service is a Log4J driven service that > supports Jakarta Commons Logging, Log4J, Avalon Logging, SLF4J an > d Pax Logging clients. Note that all this clients must use the Pax Lo > gging Client library in the proper way. See documentation for deta > ils. > Bundle-DocURL: http://www.ops4j.org/projects/pax/logging/pax-logging-s > ervice > Bundle-SymbolicName: org.ops4j.pax.logging.pax-logging-service > Import-Package: com.ibm.uvm.tools;resolution:=optional,com.sun.jdmk.co > mm;resolution:=optional,javax.jmdns;resolution:=optional,javax.jms;re > solution:=optional,javax.mail;resolution:=optional,javax.mail.interne > t;resolution:=optional,javax.management;resolution:=optional,javax.na > ming;resolution:=optional,javax.swing;resolution:=optional,javax.swin > g.border;resolution:=optional,javax.swing.event;resolution:=optional, > javax.swing.table;resolution:=optional,javax.swing.text;resolution:=o > ptional,javax.swing.tree;resolution:=optional,javax.xml.parsers,org.a > pache.avalon.framework.logger;version="4.3",org.apache.commons.loggin > g;version="1.1",org.apache.juli.logging;version="1.0",org.knopflerfis > h.service.log;provider=paxlogging;version="[1.1.0,2.0.0)",org.ops4j.p > ax.logging;version="[0.9.5,2.0.0)",org.ops4j.pax.logging.avalon;versi > on="1.6",org.ops4j.pax.logging.slf4j;version="1.6",org.ops4j.pax.logg > ing.spi;provider=paxlogging;version="1.6",org.osgi.framework;version= > "[1.0.0,2.0.0)",org.osgi.service.cm;version="[1.0.0,2.0.0)",org.osgi. > service.event;resolution:=optional;version="[1.0.0,2.0.0)",org.osgi.s > ervice.log;version="[1.3.0,2.0.0)",org.osgi.util.tracker;version="[1. > 3.0,2.0.0)",org.slf4j;version="1.6",org.w3c.dom,org.xml.sax,org.xml.s > ax.helpers > Embed-Dependency: log4j;inline=true > > > > > > > > > > > > > > > > > > > _______________________________________________ > general mailing list > [email protected] > http://lists.ops4j.org/mailman/listinfo/general > > _______________________________________________ general mailing list [email protected] http://lists.ops4j.org/mailman/listinfo/general
