私はsamll Camelアプリケーションを実行しようとしていますが、log4j関連のエラーが発生しています。多くのフォーラムで、残念ながら使用していません。私はこれを解決するために手伝ってください。事前にありがとうございます。java.lang.AbstractMethodError:org.slf4j.impl.Log4jLoggerAdapter.log(ava/lang /オブジェクト; Ljava/lang/Throwable;)V
Gradleの依存関係:
+--- org.slf4j:slf4j-api:1.7.6
| | \--- org.slf4j:jcl-over-slf4j:1.7.6
| | \--- org.slf4j:slf4j-api:1.7.6
のlog4j関連の依存関係:
compile group: 'org.slf4j', name: 'jcl-over-slf4j', version:'1.5.8'
compile group: 'org.slf4j', name: 'slf4j-api', version:'1.5.8'
compile group: 'org.slf4j', name: 'slf4j-log4j12', version:'1.5.8'
compile group: 'log4j', name: 'log4j', version:'1.2.14'
例外トレース:
INFO: Spring WebApplicationInitializers detected on classpath: [[email protected]3aec64]
SLF4J: The requested version 1.5.8 by your slf4j binding is not compatible with [1.6, 1.7]
SLF4J: See http://www.slf4j.org/codes.html#version_mismatch for further details.
Jul 05, 2017 12:58:12 PM org.apache.catalina.core.ApplicationContext log
SEVERE: StandardWrapper.Throwable
java.lang.AbstractMethodError: org.slf4j.impl.Log4jLoggerAdapter.log(Lorg/slf4j/Marker;Ljava/lang/String;ILjava/lang/String;[Ljava/lang/Object;Ljava/lang/Throwable;)V
at org.apache.commons.logging.impl.SLF4JLocationAwareLog.debug(SLF4JLocationAwareLog.java:133)
at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:118)
at javax.servlet.GenericServlet.init(GenericServlet.java:158)
at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1269)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1075)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5368)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5660)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1571)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1561)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
build.gradle:
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'war'
apply plugin: "eclipse"
group = 'com.pluralsight.camel'
version = '1.0-SNAPSHOT'
description = """"""
sourceCompatibility = 1.7
targetCompatibility = 1.7
repositories {
maven { url "http://central.maven.org/maven2/" }
}
dependencies {
compile(group: 'org.springframework', name: 'spring-core', version:'4.0.4.RELEASE') {
exclude(module: 'commons-logging')
}
compile group: 'org.springframework', name: 'spring-aop', version:'4.0.4.RELEASE'
compile group: 'org.springframework', name: 'spring-context', version:'4.0.4.RELEASE'
compile group: 'org.springframework', name: 'spring-tx', version:'4.0.4.RELEASE'
compile group: 'org.springframework', name: 'spring-aspects', version:'4.0.4.RELEASE'
compile group: 'org.springframework', name: 'spring-web', version:'4.0.4.RELEASE'
compile group: 'org.springframework', name: 'spring-webmvc', version:'4.0.4.RELEASE'
compile group: 'org.springframework', name: 'spring-jdbc', version:'4.0.4.RELEASE'
compile(group: 'org.springframework.data', name: 'spring-data-jpa', version:'1.5.2.RELEASE') {
exclude(module: 'spring-aop')
}
compile group: 'javax.validation', name: 'validation-api', version:'1.0.0.GA'
compile group: 'org.hibernate', name: 'hibernate-validator', version:'4.3.1.Final'
compile group: 'org.hibernate', name: 'hibernate-core', version:'4.3.5.Final'
compile group: 'org.hibernate', name: 'hibernate-entitymanager', version:'4.3.5.Final'
compile group: 'org.hibernate.javax.persistence', name: 'hibernate-jpa-2.1-api', version:'1.0.0.Final'
compile group: 'org.springframework', name: 'spring-orm', version:'4.0.4.RELEASE'
compile group: 'org.slf4j', name: 'jcl-over-slf4j', version:'1.5.8'
compile group: 'org.slf4j', name: 'slf4j-api', version:'1.5.8'
compile group: 'org.slf4j', name: 'slf4j-log4j12', version:'1.5.8'
compile group: 'log4j', name: 'log4j', version:'1.2.14'
compile group: 'org.aspectj', name: 'aspectjrt', version:'1.7.4'
compile group: 'cglib', name: 'cglib-nodep', version:'2.2'
compile group: 'javax.inject', name: 'javax.inject', version:'1'
compile group: 'postgresql', name: 'postgresql', version:'9.1-901.jdbc4'
compile group: 'commons-dbcp', name: 'commons-dbcp', version:'1.4'
compile group: 'jstl', name: 'jstl', version:'1.2'
compile group: 'org.codehaus.jackson', name: 'jackson-mapper-asl', version:'1.9.9'
compile group: 'org.apache.tiles', name: 'tiles-jsp', version:'2.2.2'
compile group: 'org.apache.tiles', name: 'tiles-el', version:'2.2.2'
compile group: 'org.apache.commons', name: 'commons-lang3', version:'3.3.2'
compile group: 'net.sf.opencsv', name: 'opencsv', version:'2.3'
compile group: 'org.apache.camel', name: 'camel-spring', version:'2.13.2'
compile group: 'org.apache.camel', name: 'camel-spring-javaconfig', version:'2.13.2'
compile group: 'org.apache.camel', name: 'camel-test-spring', version:'2.13.2'
testCompile group: 'org.springframework', name: 'spring-test', version:'4.0.4.RELEASE'
testCompile(group: 'junit', name: 'junit-dep', version:'4.10') {
exclude(module: 'hamcrest-core')
}
testCompile group: 'org.hamcrest', name: 'hamcrest-library', version:'1.3'
testCompile group: 'org.mockito', name: 'mockito-core', version:'1.9.0'
compile(group: 'javax.servlet', name: 'javax.servlet-api', version:'3.0.1') {
/* This dependency was originally in the Maven provided scope, but the project was not of type war.
This behavior is not yet supported by Gradle, so this dependency has been converted to a compile dependency.
Please review and delete this closure when resolved. */
}
compile(group: 'javax.servlet.jsp', name: 'jsp-api', version:'2.2') {
/* This dependency was originally in the Maven provided scope, but the project was not of type war.
This behavior is not yet supported by Gradle, so this dependency has been converted to a compile dependency.
Please review and delete this closure when resolved. */
}
}
あなたのstacktraceは 'SLF4J:あなたのslf4jバインディングによって要求されたバージョン1.5.8は[1.6、1.7]'と互換性がないと言います。それは文字通り問題を記述します。この例外があなたのために印刷された[このリンク](https://www.slf4j.org/codes.html#version_mismatch)を見ましたか? – Nathan
ありがとう@Nathanこれは役に立ちました。 – sunleo