java - Class path contains multiple SLF4J bindings after exclusion -
i've error "class path contains multiple slf4j bindings." when starting web-app server. solutions i've found here didn't seem work. i've excluded artifacts domain still error. don't understand why have error after exclusions. i'm using glassfish 4.1.1 server.
severe: slf4j: class path contains multiple slf4j bindings. severe: slf4j: found binding in [jar:file:/c:/glassfish4.1.1/glassfish/domains/domain1/eclipseapps/csbasement/web-inf/lib/slf4j-log4j12-1.7.12.jar!/org/slf4j/impl/staticloggerbinder.class] severe: slf4j: found binding in [jar:file:/c:/glassfish4.1.1/glassfish/domains/domain1/eclipseapps/csbasement/web-inf/lib/slf4j-simple-1.7.12.jar!/org/slf4j/impl/staticloggerbinder.class] severe: slf4j: see http://www.slf4j.org/codes.html#multiple_bindings explanation.
i excluded artifact seen in link furnished in error code :
<!-- slf4j --> <dependency> <groupid>org.slf4j</groupid> <artifactid>slf4j-api</artifactid> <version>1.7.12</version> <exclusions> <exclusion> <groupid>org.slf4j</groupid> <artifactid>slf4j-log4j12</artifactid> </exclusion> </exclusions> </dependency> <dependency> <groupid>org.slf4j</groupid> <artifactid>slf4j-simple</artifactid> <version>1.7.12</version> <exclusions> <exclusion> <groupid>org.slf4j</groupid> <artifactid>slf4j-log4j12</artifactid> </exclusion> </exclusions> </dependency>
mvn:tree:
[info] --- maven-dependency-plugin:2.8:tree (default-cli) @ maventest --- [info] maventest:maventest:jar:0.0.1-snapshot [info] +- org.omnifaces:omnifaces:jar:2.1:compile [info] +- org.webjars:font-awesome:jar:4.4.0:compile [info] +- org.ocpsoft.rewrite:rewrite-servlet:jar:2.0.12.final:compile [info] +- org.ocpsoft.rewrite:rewrite-config-prettyfaces:jar:2.0.12.final:compile [info] | +- org.ocpsoft.rewrite:rewrite-annotations-impl:jar:2.0.12.final:compile [info] | | +- org.ocpsoft.rewrite:rewrite-api:jar:2.0.12.final:compile [info] | | | +- org.ocpsoft.common:common-api:jar:1.0.5.final:compile [info] | | | \- org.ocpsoft.logging:logging-api:jar:1.0.2.final:compile [info] | | +- org.ocpsoft.rewrite:rewrite-api-servlet:jar:2.0.12.final:compile [info] | | | \- org.ocpsoft.rewrite:rewrite-addressbuilder:jar:2.0.12.final:compile [info] | | \- org.ocpsoft.rewrite:rewrite-annotations-api:jar:2.0.12.final:compile [info] | \- org.ocpsoft.rewrite:rewrite-integration-faces:jar:2.0.12.final:compile [info] +- commons-io:commons-io:jar:2.4:compile [info] +- org.primefaces:primefaces:jar:5.3:compile [info] +- org.apache.httpcomponents:httpclient:jar:4.5:compile [info] | +- org.apache.httpcomponents:httpcore:jar:4.4.1:compile [info] | +- commons-logging:commons-logging:jar:1.2:compile [info] | \- commons-codec:commons-codec:jar:1.9:compile [info] +- com.google.guava:guava:jar:18.0:compile [info] +- org.twitter4j:twitter4j-core:jar:4.0.4:compile [info] +- org.twitter4j:twitter4j-stream:jar:4.0.4:compile [info] +- com.twitter:hbc-core:jar:2.2.0:compile [info] | +- com.twitter:joauth:jar:6.0.2:compile [info] | \- com.google.code.findbugs:jsr305:jar:1.3.9:compile [info] +- org.slf4j:slf4j-api:jar:1.7.12:compile [info] +- org.slf4j:slf4j-simple:jar:1.7.12:compile [info] +- org.jsoup:jsoup:jar:1.8.2:compile [info] +- com.ocpsoft:ocpsoft-pretty-time:jar:1.0.7:compile [info] +- jstl:jstl:jar:1.2:compile [info] \- com.google.code.gson:gson:jar:2.3.1:compile
and here whole pom.xml:
<project xmlns="http://maven.apache.org/pom/4.0.0" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://maven.apache.org/pom/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelversion>4.0.0</modelversion> <groupid>maventest</groupid> <artifactid>maventest</artifactid> <version>0.0.1-snapshot</version> <build> <sourcedirectory>src</sourcedirectory> <plugins> <plugin> <artifactid>maven-compiler-plugin</artifactid> <version>3.3</version> <configuration> <source>1.8</source> <target>1.8</target> </configuration> </plugin> </plugins> </build> <dependencies> <!-- omnifaces --> <dependency> <groupid>org.omnifaces</groupid> <artifactid>omnifaces</artifactid> <version>2.1</version> </dependency> <!-- font awesome --> <dependency> <groupid>org.webjars</groupid> <artifactid>font-awesome</artifactid> <version>4.4.0</version> </dependency> <dependency> <groupid>org.ocpsoft.rewrite</groupid> <artifactid>rewrite-servlet</artifactid> <version>2.0.12.final</version> </dependency> <dependency> <groupid>org.ocpsoft.rewrite</groupid> <artifactid>rewrite-config-prettyfaces</artifactid> <version>2.0.12.final</version> </dependency> <dependency> <groupid>commons-io</groupid> <artifactid>commons-io</artifactid> <version>2.4</version> </dependency> <dependency> <groupid>org.primefaces</groupid> <artifactid>primefaces</artifactid> <version>5.3</version> </dependency> <dependency> <groupid>org.apache.httpcomponents</groupid> <artifactid>httpclient</artifactid> <version>4.5</version> </dependency> <!-- twitter --> <dependency> <groupid>com.google.guava</groupid> <artifactid>guava</artifactid> <version>18.0</version> </dependency> <dependency> <groupid>org.twitter4j</groupid> <artifactid>twitter4j-core</artifactid> <version>4.0.4</version> </dependency> <dependency> <groupid>org.twitter4j</groupid> <artifactid>twitter4j-stream</artifactid> <version>4.0.4</version> </dependency> <dependency> <groupid>com.twitter</groupid> <artifactid>hbc-twitter4j</artifactid> <version>2.2.0</version> </dependency> <dependency> <groupid>com.twitter</groupid> <artifactid>hbc-core</artifactid> <!-- or hbc-twitter4j --> <version>2.2.0</version> <!-- or whatever latest version --> </dependency> <!-- slf4j --> <dependency> <groupid>org.slf4j</groupid> <artifactid>slf4j-api</artifactid> <version>1.7.12</version> <exclusions> <exclusion> <groupid>org.slf4j</groupid> <artifactid>slf4j-log4j12</artifactid> </exclusion> </exclusions> </dependency> <dependency> <groupid>org.slf4j</groupid> <artifactid>slf4j-simple</artifactid> <version>1.7.12</version> <exclusions> <exclusion> <groupid>org.slf4j</groupid> <artifactid>slf4j-log4j12</artifactid> </exclusion>
you building .jar
, , if .jar
not end-point standalone application (i.e. start java -jar myjar.jar
, while adding dependency war
web application), should not include slf4j implementations. so, delete slf4j-simple
dependency.
Comments
Post a Comment