【问题标题】:Spring Boot and Apache Spark Security Exception: signer mismatchSpring Boot 和 Apache Spark 安全异常:签名者不匹配
【发布时间】: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


    【解决方案1】:

    好吧,我想我可能已经解决了。我确实需要进行一些进一步的测试。

    在调查中,似乎配置了spark to run on Jetty,而不是Tomcat。查看日志文件,我可以看到它正在尝试使用 Jetty。

    我查看了依赖项,发现了一个org.eclipse.jetty.orbit。我设法通过在configurations.all 中添加以下内容来排除它

    exclude module: 'javax.servlet'
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-09-13
      • 2012-02-11
      • 2021-02-21
      • 2020-12-05
      • 1970-01-01
      • 2016-03-03
      • 1970-01-01
      相关资源
      最近更新 更多