kansifang / moquette-mqtt

Automatically exported from code.google.com/p/moquette-mqtt
Apache License 2.0
0 stars 0 forks source link

Logging failure in OSGI container #40

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Running moquette in an OSGi container results in an exception from SLF4J:

osgi> SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further 
details.

The broker still works in Equinox as it successfully falls back to a NOP logger 
configuration. In Felix and Concierge, the broker will not start up at all due 
to this resolution failure.

To test / demonstrate, change "equinox" to "felix" in the framework section of 
bundle/pom.xml

Reading around, it looks like SLF4J has some issues in OSGi containers.

Original issue reported on code.google.com by andypiperuk on 19 Mar 2014 at 9:39

GoogleCodeExporter commented 9 years ago
Hi Andy, I've tried to manage this issue, and seems like that the bundle of 
log4j is not included into the install list.
 I've seen that (for Felix and pax-runner 1.4) forcing the dependency to be installed, including 
<dependency>
      <groupId>log4j</groupId>
      <artifactId>log4j</artifactId>
      <version>1.2.17</version>
      <scope>provided</scope>
</dependency>
 but after this, the OSGi compendium bundle also required javax.servlet bundle, so I decided to update the pax-runner to version 1.8.5 and this fixed the issue for Felix and Equinox, and this give a new OSGi shell that make the container start with these bundles.

Original comment by selva.an...@gmail.com on 11 Jun 2014 at 9:00