Question: I am using querydsl (which depends on sl4j-api 1.6) and arquillian-persistence-api (which depends on slf4j-jdk14 1.5.6).
If I ignore in maven the older version 1.5.6 I get the following message on JBoss

`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.`

I am using arquillian with managed JBoss AS 7.1 for testing (Maven downloads the version from maven central and run the tests).
I am also using arquillian persistence api.

What should I do to correct the given warning? I mean which dependency should I keep or how would I allow both to work properly?

I suppose this is why I am not getting any error messages on arquillian persistence api failure (because the logger is not working?).

Answer: 
The message you are seeing is a warning, not an error. It means SLF4J is selecting a binding for you because you've not chosen one yourself. The default binding simply discards all log messages, which is not very useful.

If you have conflicting versions in Maven, normally it's safer to force the newer version. Libraries are *often* backwards compatible.

So, stick with your newer version of `slf4j-api` and just ensure you declare a binding as a dependency, e.g. `slf4j-jdk14`. If you are producing a library, ensure your binding is declared with `test` scope only.
JBoss 7.1 has built-in support for SLF4J. Assuming this is a web application with WAR packaging you add `src/main/webapp/WEB-INF/jboss-deployment-structure.xml`:

```
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.0">
  <deployment>
    <dependencies>
      <module name="org.slf4j" />
    </dependencies>
  </deployment>
</jboss-deployment-structure>

```

This will pull in the JBoss SL4J adapter which will give you logging output.

This implies that you want to use the application server provided libraries for SLF4J. You ought to update your `pom.xml` to fix the scope of the SLF4J dependency.

```
<dependencies>
  ...
  <dependency>
    <groupId>org.slf4j</groupId>
    <artifactId>slf4j-api</artifactId>
    <scope>provided</scope>
  </dependency>
  ...
</dependencies>

```

Depending on how your POM file is arranged you may also need to give the version of SLF4J you want to use. `mvn dependency:tree` can show you which SLF4J deps are being pulled in. Make sure they are all getting the "provided" scope. If you use Eclipse and the m2e plugin you can also open your POM file and check the "Dependency Hierarchy" tab which will provide you with similar information.