зависимостта slf4j не е намерена

Когато се опитвам да разположа моето уеб приложение, то се проваля поради грешки в регистрирането, като например следното:

java.lang.NoSuchMethodError: org.slf4j.spi.LocationAwareLogger.log(Lorg/slf4j/Marker;Ljava/lang/String;ILjava/lang/String;Ljava/lang/Throwable;)

Потърсих в Google тази грешка и изглежда, че е проблем с една от моите зависимости, която изтегля грешна версия, но не мога да намеря къде се случва това. Включих изхода на дървото на зависимостите:

въведете описание на изображението тук

Някакви идеи?

РЕДАКТИРАНЕ: Добавен изход на mvn dependency:resolve:

[INFO] The following files have been resolved:
[INFO]    org.slf4j:slf4j-log4j12:jar:1.6.0:compile
[INFO]    org.apache.tiles:tiles-request-jsp:jar:1.0.1:compile
[INFO]    log4j:log4j:jar:1.2.14:compile
[INFO]    org.codehaus.jackson:jackson-mapper-asl:jar:1.8.5:compile
[INFO]    mysql:mysql-connector-java:jar:5.1.15:compile
[INFO]    commons-beanutils:commons-beanutils:jar:1.8.0:compile
[INFO]    org.springframework.social:spring-social-web:jar:1.0.0.RELEASE:compile
[INFO]    org.springframework:spring-orm:jar:3.2.4.RELEASE:compile
[INFO]    antlr:antlr:jar:2.7.6:compile
[INFO]    org.springframework:spring-tx:jar:3.2.4.RELEASE:compile
[INFO]    org.springframework:spring-expression:jar:3.2.4.RELEASE:compile
[INFO]    org.springframework:spring-core:jar:3.2.4.RELEASE:compile
[INFO]    org.springframework:spring-webmvc:jar:3.2.4.RELEASE:compile
[INFO]    org.yaml:snakeyaml:jar:1.12:compile
[INFO]    org.apache.tiles:tiles-core:jar:3.0.1:compile
[INFO]    commons-collections:commons-collections:jar:3.1:compile
[INFO]    junit:junit:jar:3.8.1:test
[INFO]    org.apache.tiles:tiles-jsp:jar:3.0.1:compile
[INFO]    commons-logging:commons-logging:jar:1.1.1:compile
[INFO]    org.springframework.social:spring-social-facebook:jar:1.0.0.RELEASE:compile
[INFO]    org.springframework:spring-jdbc:jar:3.2.4.RELEASE:compile
[INFO]    org.liquibase:liquibase-core:jar:3.0.2:compile
[INFO]    org.apache.tiles:tiles-request-servlet:jar:1.0.1:compile
[INFO]    org.springframework:spring-web:jar:3.2.4.RELEASE:compile
[INFO]    org.apache.tiles:tiles-request-api:jar:1.0.1:compile
[INFO]    org.codehaus.jackson:jackson-core-asl:jar:1.8.5:compile
[INFO]    org.slf4j:jcl-over-slf4j:jar:1.5.8:compile
[INFO]    org.slf4j:slf4j-api:jar:1.6.1:compile
[INFO]    javax.inject:javax.inject:jar:1:compile
[INFO]    dom4j:dom4j:jar:1.6.1:compile
[INFO]    javax.servlet:jstl:jar:1.2:compile
[INFO]    org.springframework.social:spring-social-core:jar:1.0.0.RELEASE:compile
[INFO]    org.springframework.security:spring-security-crypto:jar:3.1.0.RC3:compile
[INFO]    commons-digester:commons-digester:jar:2.0:compile
[INFO]    org.springframework:spring-context:jar:3.2.4.RELEASE:compile
[INFO]    org.apache.tiles:tiles-template:jar:3.0.1:compile
[INFO]    org.hibernate:hibernate-core:jar:3.6.10.Final:compile
[INFO]    org.apache.tiles:tiles-autotag-core-runtime:jar:1.1.0:compile
[INFO]    org.hibernate.javax.persistence:hibernate-jpa-2.0-api:jar:1.0.1.Final:compile
[INFO]    org.springframework:spring-aop:jar:3.2.4.RELEASE:compile
[INFO]    org.springframework:spring-beans:jar:3.2.4.RELEASE:compile
[INFO]    org.apache.tiles:tiles-api:jar:3.0.1:compile
[INFO]    aopalliance:aopalliance:jar:1.0:compile
[INFO]    org.springframework.social:spring-social-twitter:jar:1.0.0.RELEASE:compile
[INFO]    javax.transaction:jta:jar:1.1:compile
[INFO]    org.hibernate:hibernate-commons-annotations:jar:3.2.0.Final:compile
[INFO]    org.apache.tiles:tiles-servlet:jar:3.0.1:compile

person Nick    schedule 23.08.2013    source източник
comment
Защо споменавате log4j? Няма нищо за това в съобщението ви за грешка. Освен това, моля, публикувайте целия резултат от mvn dependency:resolve като текст.   -  person chrylis -cautiouslyoptimistic-    schedule 23.08.2013
comment
Log4j е реализацията на Slf4j, която използвам.   -  person Nick    schedule 23.08.2013


Отговори (1)


Уверете се, че всички slf4j-пакети (slf4j-api, slf4j-log4j12, jcl-over-slf4j) са от една и съща версия. Особено несъответствията в второстепенната версия (между api и jcl-bridge) са проблематични и трябва да се избягват. Тъй като използвате maven, не би трябвало да е трудно изрично да декларирате една и съща конкретна версия за всички тези пакети.

Вижте също тук: http://www.slf4j.org/codes.html#version_mismatch

person sheltem    schedule 23.08.2013