[gatling-maven-plugin] Maven conflict in existing SLF4J

200 views
Skip to first unread message

Newb

unread,
Jun 13, 2017, 3:52:25 AM6/13/17
to Gatling User Group
Hi Guys,

I'm wondering if you guys had this problem causing gatling-maven-plugin to fail build:
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/C:/jnoprad1/DevTools/maven_repo/repository/org/slf4j/slf4j-log4j12/1.7.22/slf4j-log4j12-1.7.22.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/C:/jnoprad1/DevTools/maven_repo/repository/ch/qos/logback/logback-classic/1.1.7/logback-classic-1.1.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.slf4j.impl.Log4jLoggerFactory]
java.lang.reflect.InvocationTargetException
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
       at java.lang.reflect.Method.invoke(Method.java:491)
       at io.gatling.mojo.MainWithArgsInFile.runMain(MainWithArgsInFile.java:50)
       at io.gatling.mojo.MainWithArgsInFile.main(MainWithArgsInFile.java:33)
Caused by: java.lang.ClassCastException: org.slf4j.impl.Log4jLoggerFactory cannot be cast to ch.qos.logback.classic.LoggerContext
       at io.gatling.app.Gatling$.start(Gatling.scala:66)
       at io.gatling.app.Gatling$.fromArgs(Gatling.scala:43)
       at io.gatling.app.Gatling$.main(Gatling.scala:35)
       at io.gatling.app.Gatling.main(Gatling.scala)

I currently have the following SLF4J dependencies in my project:
<dependency>
  <groupId>org.slf4j</groupId>
  <artifactId>slf4j-api</artifactId>
  <version>1.7.22</version>
</dependency>
<dependency>
  <groupId>org.slf4j</groupId>
  <artifactId>slf4j-log4j12</artifactId>
  <version>1.7.22</version>
  <scope>test</scope>
</dependency>

I've tried excluding the slf4j libraries as mentioned in other threads but build still fails:
<dependency>
  <groupId>io.gatling.highcharts</groupId>
  <artifactId>gatling-charts-highcharts</artifactId>
  <version>${gatling.version}</version>
  <exclusions>
    <exclusion>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
    </exclusion>
    <exclusion>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-log4j12</artifactId>
    </exclusion>
  </exclusions>
</dependency>

Thanks!

Reply all
Reply to author
Forward
0 new messages