尝试部署 Web 应用程序时,由于日志记录错误(如下所示),它将失败:
Java . lang . nosuchmethoderror:org . SLF 4j . SPI . locationawarelogger . log(Lorg/SLF 4j/Marker;ljava/lang/String;il Java/lang/String;ljava/lang/Throwable;)
我已经谷歌了这个错误,这似乎是我的一个依赖项拉入错误版本的问题,但我找不到发生这种情况的地方。我已经包含了依赖关系树输出:
有什么想法吗?
EDIT:添加了mvn依赖项的输出: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
确保所有slf4j包(slf4j-api、slf4j-log4j12、jcl-over-slf4j)的版本相同。尤其是次要版本中的不匹配(api和jcl-bridge之间)是有问题的,应该避免。因为您使用maven,所以为所有这些包显式声明相同的特定版本应该不难。
另见此处:http://www.slf4j.org/codes.html#version_mismatch
我创建了一个sbt项目。在命令行调用sbt compile可以很好地工作: scalaVersion:=“2.9.2” project/plugins.sbt addSbtPlugin(“com.typesafe.sbteclipse”%“sbteclipse-plugin”%“2.1.0”) 我现在发现控制台上的“SBT测试”也不起作用。所以我认为这不是sbteclipse的问题,而是如何处理测
我已经在gradle文件中添加了依赖项,但仍然无法识别jar文件的类。 我得到错误-不能解决类在这里 我已经提到了以下几点 Android Studio缺少外部依赖项 Android Studio坚持使用“Gradle:resolve Dependencies'_debugCompile'”或“detachedConfiguration1” 如何添加本地. jar文件依赖build.gradle文
这是build.sbt文件: 更新:查看解析器 [play21-osm]$show resolvers[信息]列表(Typesafe Releases repository:http://repo.Typesafe.com/Typesafe/Releases/,Typesafe relepository:http://Typesafe.artifactoryonline.com/Typesafe,
对于那些对整个pom.xml感兴趣的人来说:
关于解决依赖关系,我与sbt有一些问题。 built.sbt Sbt版本:来自arch community repository的Sbt 1.0.0-2 运行操作系统:Antergos内核4.12.8-2-arch