Hi, John,

I have arranged as follows:

<dependencies>

<dependency>
<groupId>org.simpleframework</groupId>
<artifactId>simple-xml</artifactId>
<version>2.6</version>
</dependency>

<dependency>
<groupId>org.apache.geode</groupId>
<artifactId>gemfire-core</artifactId>
<version>1.0.0-incubating.M1</version>
</dependency>


<!-- http://mvnrepository.com/artifact/org.asteriskjava/asterisk-java -->
<dependency>
<groupId>org.asteriskjava</groupId>
<artifactId>asterisk-java</artifactId>
<version>1.0.0.M3</version>
<exclusions>
<exclusion>
<groupId>com.sun.jmx</groupId>
<artifactId>jmxri</artifactId>
</exclusion>
<exclusion>
<groupId>com.sun.jdmk</groupId>
<artifactId>jmxtools</artifactId>
</exclusion>
<exclusion>
<groupId>javax.jms</groupId>
<artifactId>jms</artifactId>
</exclusion>
</exclusions>
</dependency>


<dependency>
<groupId>eu.exodussoft.css.commons</groupId>
<artifactId>csscommons</artifactId>
<version>0.1.0</version>
</dependency>

</dependencies>

<dependencyManagement>
<dependencies>

<!-- http://mvnrepository.com/artifact/ch.qos.logback/logback-core -->
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-core</artifactId>
<version>1.1.3</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.7.7</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.7.7</version>
</dependency>
</dependencies>
</dependencyManagement>


However, it doesn't work... No logs... and it gives the following message
(should I ignore these warnings?):

SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in
[jar:file:/C:/Users/admin/.m2/repository/org/apache/logging/log4j/log4j-slf4j-impl/2.5/log4j-slf4j-impl-2.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in
[jar:file:/C:/Users/admin/.m2/repository/org/slf4j/slf4j-log4j12/1.7.7/slf4j-log4j12-1.7.7.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an
explanation.
SLF4J: Actual binding is of type
[org.apache.logging.slf4j.Log4jLoggerFactory]


On Sun, Jun 5, 2016 at 1:19 AM, John Blum <[email protected]> wrote:

> Rather than "excluding" the dependency, you rather might add a dependency
> management section to your application POM file to ensure that only a
> single version of the SLF4J dependencies (and in particular, the
> slf4j-log4j12 bridge) is present.  For example...
>
> <dependencyManagement>
>   <dependencies>
>     <dependency>
>       <groupId>org.slf4j</groupId>
>       <artifactId>slf4j-log4j12</artifactId>
>       *<version>1.7.7</version>*
>     </dependency>
>   </dependencies>
> </dependencyManagement>
>
> The version is based on the version called out in the
> dependency-versions.properties
> <https://github.com/apache/incubator-geode/blob/rel/v1.0.0-incubating.M2/gradle/dependency-versions.properties#L86>
>  [1]
> file.
>
> To my understanding, *Apache Geode* at version *1.0.0-incubating.M2* had
> properly resolved all dependencies and cleaned up the dependency graph/tree
> so that only a single version of any dependency is present.  Are you using
> SLF4J in your application and possibly pulling in a different version?
>
> Either way, no matter, the "dependencyManagement" section will properly
> constrain the SLF4J dependencies.  You can declare any other possibly
> conflicting dependencies in the dependencyManagement section of your POM
> file as well.
>
> Hope this helps!
>
> -John
>
>
> [1]
> https://github.com/apache/incubator-geode/blob/rel/v1.0.0-incubating.M2/gradle/dependency-versions.properties#L86
>
>
> On Sat, Jun 4, 2016 at 8:49 AM, Ali Koyuncu <[email protected]> wrote:
>
>> Hi, everyone,
>>
>> Everything with my Java code seems all right. However, when I am to
>> deploy SLF4J and Log4J, I have the following run-time exception/warning:
>>
>> "Multiple SLF4J bindings on the classpath"
>>
>> Well, to get rid of this warning/exception, in *pom.xml *I have arranged
>> the dependencies as follows:
>>
>> <dependencies>
>>
>>
>> <dependency>
>>
>> <groupId>org.simpleframework</groupId>
>>
>> <artifactId>simple-xml</artifactId>
>>
>> <version>2.6</version>
>>
>> <exclusions>
>>
>> <exclusion>
>>
>> <groupId>org.slf4j</groupId>
>>
>> <artifactId>slf4j-log4j12</artifactId>
>>
>> </exclusion>
>>
>> </exclusions>
>>
>> </dependency>
>>
>>
>> <dependency>
>>
>> <groupId>org.apache.geode</groupId>
>>
>> <artifactId>gemfire-core</artifactId>
>>
>> <version>1.0.0-incubating.M1</version>
>>
>> <exclusions>
>>
>> <exclusion>
>>
>> <groupId>org.slf4j</groupId>
>>
>> <artifactId>slf4j-log4j12</artifactId>
>>
>> </exclusion>
>>
>> </exclusions>
>>
>> </dependency>
>>
>>
>> </dependencies>
>>
>>
>> After that, the warning message disappears. On Eclipse, everything seems
>> fine. However, when I am to deploy this code in Ubuntu, no log file is
>> generated -- I also tried different combinations.
>>
>> Any comments on how to solve this case will be appreciated.
>>
>> Thank you in advance.
>>
>>
>>
>> --
>>
>> With my warm regards,
>>
>> Ali KOYUNCU
>>
>
>
>
> --
> -John
> 503-504-8657
> john.blum10101 (skype)
>



-- 

Saygılarımla, with my warm regards,

Ali KOYUNCU

Reply via email to