【发布时间】:2016-05-15 09:30:54
【问题描述】:
解决了一个问题导致了下一个问题,现在我收到一个关于签名者不匹配的错误。请看下面:
这是我原来的 gradle 构建文件:
buildscript {
ext {
springBootVersion = '1.3.3.RELEASE'
}
repositories {
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
}
}
apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'eclipse'
apply plugin: 'spring-boot'
jar {
baseName = 'appTest'
version = '1.0.0'
}
sourceCompatibility = 1.8
targetCompatibility = 1.8
repositories {
mavenCentral()
}
dependencies {
compile('org.springframework.boot:spring-boot-starter-web')
//compile 'org.apache.spark:spark-core_2.11:1.4.0' //problem here
compile("org.springframework.boot:spring-boot-starter-data-jpa")
compile("com.h2database:h2")
compile('mysql:mysql-connector-java')
testCompile("junit:junit")
testCompile('org.springframework.boot:spring-boot-starter-test')
testCompile("junit:junit")
}
task wrapper(type: Wrapper) {
gradleVersion = '2.9'
}
如果我尝试在不添加依赖项compile 'org.apache.spark:spark-core_2.11:1.4.0' 的情况下进行构建,它会运行。但是,如果我尝试使用该依赖项运行它,我会得到:
FAILURE: Build failed with an exception.
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/C:/Users/xxx/.gradle/caches/modules-2/files-2.1/org.slf4j/slf4j-log4j12/1.7.16/54c6dd23a7c420e40b8848e962d5f2a3534260af/slf4j-log4j12-1.7.16.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/C:/Users/xxx/.gradle/caches/modules-2/files-2.1/ch.qos.logback/logback-classic/1.1.5/92353eb144695bba80b31f7bec4f36d871f230ac/logback-classic-1.1.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
研究,我发现this。然后我尝试通过添加以下内容来排除 slf4j-log4j12(就在我的 gradle 构建文件中的 jar{...} 上方):
configurations.all {
exclude module: 'slf4j-log4j12'
}
实际构建。但是,当我尝试通过bootRun 运行它时,我得到另一个错误:
Caused by: java.lang.SecurityException: class "javax.servlet.http.HttpSessionIdListener"'s signer information does not match signer information of other classes in the same package
我认为这是由于使用了多个具有不同签名的 jar?我该如何解决这个问题?请帮忙!
完整错误,view here.
【问题讨论】:
标签: java spring gradle apache-spark spring-boot