我正在构建一个在我的本地开发机器上完美运行的REST API,但是当我将完全相同的war文件部署到我的测试服务器时,我收到以下错误:
java.lang.NoSuchMethodError:
javax.ws.rs.core.Application.getProperties()Ljava/util/Map;
我已经检查了我的依赖项,但是在它的构建脚本中找不到碰撞,我在build.gradle中有了一个后续行
compile group: 'javax.ws.rs', name: 'javax.ws.rs-api', version: '2.1-m09'
作为参考,我在两台机器上的tomcat8和java8上运行
有谁知道可能导致此行为的原因?
从运行gradle依赖
+--- com.wordnik:swagger-jaxrs_2.10:1.3.13
| +--- org.scala-lang:scala-library:2.10.4
| +--- com.wordnik:swagger-core_2.10:1.3.13
| | +--- org.slf4j:slf4j-api:1.6.3 -> 1.7.22
| | +--- com.fasterxml.jackson.module:jackson-module-scala_2.10:2.4.1
| | | +--- org.scala-lang:scala-library:2.10.4
| | | +--- org.scala-lang:scala-reflect:2.10.4
| | | | \--- org.scala-lang:scala-library:2.10.4
| | | +--- com.fasterxml.jackson.core:jackson-core:2.4.1 -> 2.8.5
| | | +--- com.fasterxml.jackson.core:jackson-annotations:2.4.1 -> 2.8.5
| | | +--- com.fasterxml.jackson.core:jackson-databind:2.4.1.1 -> 2.8.5
| | | | +--- com.fasterxml.jackson.core:jackson-annotations:2.8.0 -> 2.8.5
| | | | \--- com.fasterxml.jackson.core:jackson-core:2.8.5
| | | +--- com.thoughtworks.paranamer:paranamer:2.6
| | | +--- com.google.code.findbugs:jsr305:2.0.1
| | | \--- com.google.guava:guava:15.0 -> 20.0
| | +--- com.fasterxml.jackson.core:jackson-annotations:2.4.1 -> 2.8.5
| | +--- com.fasterxml.jackson.module:jackson-module-jsonSchema:2.4.1
| | | +--- com.fasterxml.jackson.core:jackson-annotations:2.4.0 -> 2.8.5
| | | +--- com.fasterxml.jackson.core:jackson-core:2.4.1 -> 2.8.5
| | | \--- com.fasterxml.jackson.core:jackson-databind:2.4.1 -> 2.8.5 (*)
| | +--- com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:2.4.1 -> 2.8.4
| | | +--- com.fasterxml.jackson.jaxrs:jackson-jaxrs-base:2.8.4
| | | | +--- com.fasterxml.jackson.core:jackson-core:2.8.4 -> 2.8.5
| | | | \--- com.fasterxml.jackson.core:jackson-databind:2.8.4 -> 2.8.5 (*)
| | | +--- com.fasterxml.jackson.core:jackson-core:2.8.4 -> 2.8.5
| | | +--- com.fasterxml.jackson.core:jackson-databind:2.8.4 -> 2.8.5 (*)
| | | \--- com.fasterxml.jackson.module:jackson-module-jaxb-annotations:2.8.4
| | | +--- com.fasterxml.jackson.core:jackson-core:2.8.4 -> 2.8.5
| | | +--- com.fasterxml.jackson.core:jackson-annotations:2.8.0 -> 2.8.5
| | | \--- com.fasterxml.jackson.core:jackson-databind:2.8.4 -> 2.8.5 (*)
| | +--- com.wordnik:swagger-annotations:1.3.13
| | +--- org.json4s:json4s-ext_2.10:3.2.11
| | | +--- org.scala-lang:scala-library:2.10.0 -> 2.10.4
| | | +--- joda-time:joda-time:2.3
| | | \--- org.joda:joda-convert:1.6
| | +--- org.json4s:json4s-native_2.10:3.2.11
| | | +--- org.scala-lang:scala-library:2.10.0 -> 2.10.4
| | | \--- org.json4s:json4s-core_2.10:3.2.11
| | | +--- org.scala-lang:scala-library:2.10.0 -> 2.10.4
| | | +--- org.json4s:json4s-ast_2.10:3.2.11
| | | | \--- org.scala-lang:scala-library:2.10.0 -> 2.10.4
| | | +--- com.thoughtworks.paranamer:paranamer:2.6
| | | \--- org.scala-lang:scalap:2.10.0
| | | \--- org.scala-lang:scala-compiler:2.10.0
| | | +--- org.scala-lang:scala-library:2.10.0 -> 2.10.4
| | | \--- org.scala-lang:scala-reflect:2.10.0 -> 2.10.4 (*)
| | \--- org.json4s:json4s-jackson_2.10:3.2.11
| | +--- org.scala-lang:scala-library:2.10.0 -> 2.10.4
| | +--- org.json4s:json4s-core_2.10:3.2.11 (*)
| | \--- com.fasterxml.jackson.core:jackson-databind:2.3.1 -> 2.8.5 (*)
| \--- org.reflections:reflections:0.9.9 -> 0.9.10
| +--- com.google.guava:guava:18.0 -> 20.0
| +--- org.javassist:javassist:3.18.2-GA -> 3.20.0-GA
| \--- com.google.code.findbugs:annotations:2.0.1
+--- javax.ws.rs:javax.ws.rs-api:2.1-m09
+--- javax.servlet:javax.servlet-api:4.0.0-b05
+--- org.springframework:spring-core:4.3.8.RELEASE
| \--- commons-logging:commons-logging:1.2
+--- org.springframework:spring-web:4.3.8.RELEASE
| +--- org.springframework:spring-aop:4.3.8.RELEASE
| | +--- org.springframework:spring-beans:4.3.8.RELEASE
| | | \--- org.springframework:spring-core:4.3.8.RELEASE (*)
| | \--- org.springframework:spring-core:4.3.8.RELEASE (*)
| +--- org.springframework:spring-beans:4.3.8.RELEASE (*)
| +--- org.springframework:spring-context:4.3.8.RELEASE
| | +--- org.springframework:spring-aop:4.3.8.RELEASE (*)
| | +--- org.springframework:spring-beans:4.3.8.RELEASE (*)
| | +--- org.springframework:spring-core:4.3.8.RELEASE (*)
| | \--- org.springframework:spring-expression:4.3.8.RELEASE
| | \--- org.springframework:spring-core:4.3.8.RELEASE (*)
| \--- org.springframework:spring-core:4.3.8.RELEASE (*)
+--- org.springframework.security:spring-security-web:4.2.2.RELEASE
| +--- aopalliance:aopalliance:1.0
| +--- org.springframework.security:spring-security-core:4.2.2.RELEASE
| | +--- aopalliance:aopalliance:1.0
| | +--- org.springframework:spring-aop:4.3.5.RELEASE -> 4.3.8.RELEASE (*)
| | +--- org.springframework:spring-beans:4.3.5.RELEASE -> 4.3.8.RELEASE (*)
| | +--- org.springframework:spring-context:4.3.5.RELEASE -> 4.3.8.RELEASE (*)
| | +--- org.springframework:spring-core:4.3.5.RELEASE -> 4.3.8.RELEASE (*)
| | \--- org.springframework:spring-expression:4.3.5.RELEASE -> 4.3.8.RELEASE (*)
| +--- org.springframework:spring-beans:4.3.5.RELEASE -> 4.3.8.RELEASE (*)
| +--- org.springframework:spring-context:4.3.5.RELEASE -> 4.3.8.RELEASE (*)
| +--- org.springframework:spring-core:4.3.5.RELEASE -> 4.3.8.RELEASE (*)
| +--- org.springframework:spring-expression:4.3.5.RELEASE -> 4.3.8.RELEASE (*)
| \--- org.springframework:spring-web:4.3.5.RELEASE -> 4.3.8.RELEASE (*)
+--- org.springframework.security:spring-security-config:4.2.2.RELEASE
| +--- aopalliance:aopalliance:1.0
| +--- org.springframework.security:spring-security-core:4.2.2.RELEASE (*)
| +--- org.springframework:spring-aop:4.3.5.RELEASE -> 4.3.8.RELEASE (*)
| +--- org.springframework:spring-beans:4.3.5.RELEASE -> 4.3.8.RELEASE (*)
| +--- org.springframework:spring-context:4.3.5.RELEASE -> 4.3.8.RELEASE (*)
| \--- org.springframework:spring-core:4.3.5.RELEASE -> 4.3.8.RELEASE (*)
+--- org.glassfish.jersey.core:jersey-client:2.25.1
| +--- javax.ws.rs:javax.ws.rs-api:2.0.1 -> 2.1-m09
| +--- org.glassfish.jersey.core:jersey-common:2.25.1
| | +--- javax.ws.rs:javax.ws.rs-api:2.0.1 -> 2.1-m09
| | +--- javax.annotation:javax.annotation-api:1.2
| | +--- org.glassfish.jersey.bundles.repackaged:jersey-guava:2.25.1
| | +--- org.glassfish.hk2:hk2-api:2.5.0-b32
| | | +--- javax.inject:javax.inject:1
| | | +--- org.glassfish.hk2:hk2-utils:2.5.0-b32
| | | | \--- javax.inject:javax.inject:1
| | | \--- org.glassfish.hk2.external:aopalliance-repackaged:2.5.0-b32
| | +--- org.glassfish.hk2.external:javax.inject:2.5.0-b32
| | +--- org.glassfish.hk2:hk2-locator:2.5.0-b32
| | | +--- org.glassfish.hk2.external:javax.inject:2.5.0-b32
| | | +--- org.glassfish.hk2.external:aopalliance-repackaged:2.5.0-b32
| | | +--- org.glassfish.hk2:hk2-api:2.5.0-b32 (*)
| | | +--- org.glassfish.hk2:hk2-utils:2.5.0-b32 (*)
| | | \--- org.javassist:javassist:3.20.0-GA
| | \--- org.glassfish.hk2:osgi-resource-locator:1.0.1
| +--- org.glassfish.hk2:hk2-api:2.5.0-b32 (*)
| +--- org.glassfish.hk2.external:javax.inject:2.5.0-b32
| \--- org.glassfish.hk2:hk2-locator:2.5.0-b32 (*)
+--- org.glassfish.jersey.core:jersey-server:2.25.1
| +--- org.glassfish.jersey.core:jersey-common:2.25.1 (*)
| +--- org.glassfish.jersey.core:jersey-client:2.25.1 (*)
| +--- javax.ws.rs:javax.ws.rs-api:2.0.1 -> 2.1-m09
| +--- org.glassfish.jersey.media:jersey-media-jaxb:2.25.1
| | +--- org.glassfish.jersey.core:jersey-common:2.25.1 (*)
| | +--- org.glassfish.hk2:hk2-api:2.5.0-b32 (*)
| | +--- org.glassfish.hk2.external:javax.inject:2.5.0-b32
| | +--- org.glassfish.hk2:hk2-locator:2.5.0-b32 (*)
| | \--- org.glassfish.hk2:osgi-resource-locator:1.0.1
| +--- javax.annotation:javax.annotation-api:1.2
| +--- org.glassfish.hk2:hk2-api:2.5.0-b32 (*)
| +--- org.glassfish.hk2.external:javax.inject:2.5.0-b32
| +--- org.glassfish.hk2:hk2-locator:2.5.0-b32 (*)
| \--- javax.validation:validation-api:1.1.0.Final
+--- org.glassfish.jersey.core:jersey-common:2.25.1 (*)
+--- org.glassfish.jersey.containers:jersey-container-servlet:2.25.1
| +--- org.glassfish.jersey.containers:jersey-container-servlet-core:2.25.1
| | +--- org.glassfish.hk2.external:javax.inject:2.5.0-b32
| | +--- org.glassfish.jersey.core:jersey-common:2.25.1 (*)
| | +--- org.glassfish.jersey.core:jersey-server:2.25.1 (*)
| | \--- javax.ws.rs:javax.ws.rs-api:2.0.1 -> 2.1-m09
| +--- org.glassfish.jersey.core:jersey-common:2.25.1 (*)
| +--- org.glassfish.jersey.core:jersey-server:2.25.1 (*)
| \--- javax.ws.rs:javax.ws.rs-api:2.0.1 -> 2.1-m09
+--- com.google.code.gson:gson:2.8.0
+--- org.glassfish.jersey.media:jersey-media-json-jackson:2.25.1
| +--- org.glassfish.jersey.core:jersey-common:2.25.1 (*)
| +--- org.glassfish.jersey.ext:jersey-entity-filtering:2.25.1
| | \--- javax.ws.rs:javax.ws.rs-api:2.0.1 -> 2.1-m09
| +--- com.fasterxml.jackson.jaxrs:jackson-jaxrs-base:2.8.4 (*)
| +--- com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:2.8.4 (*)
| \--- com.fasterxml.jackson.core:jackson-annotations:2.8.4 -> 2.8.5
+--- org.hibernate:hibernate-core:5.2.9.Final -> 5.2.10.Final
| +--- org.jboss.logging:jboss-logging:3.3.0.Final
| +--- org.hibernate.javax.persistence:hibernate-jpa-2.1-api:1.0.0.Final
| +--- org.javassist:javassist:3.20.0-GA
| +--- antlr:antlr:2.7.7
| +--- org.jboss.spec.javax.transaction:jboss-transaction-api_1.2_spec:1.0.1.Final
| +--- org.jboss:jandex:2.0.3.Final
| +--- com.fasterxml:classmate:1.3.0
| +--- dom4j:dom4j:1.6.1
| \--- org.hibernate.common:hibernate-commons-annotations:5.0.1.Final
| \--- org.jboss.logging:jboss-logging:3.3.0.Final
+--- mysql:mysql-connector-java:5.1.39
+--- org.apache.httpcomponents:httpclient:4.3.4
| +--- org.apache.httpcomponents:httpcore:4.3.2
| +--- commons-logging:commons-logging:1.1.3 -> 1.2
| \--- commons-codec:commons-codec:1.6
+--- commons-httpclient:commons-httpclient:3.1
| +--- commons-logging:commons-logging:1.0.4 -> 1.2
| \--- commons-codec:commons-codec:1.2 -> 1.6
+--- org.apache.logging.log4j:log4j-api:2.7
+--- org.apache.logging.log4j:log4j-core:2.7
| \--- org.apache.logging.log4j:log4j-api:2.7
\--- se.mulander.cosmos:common:1.1
+--- io.swagger:swagger-jersey-jaxrs:1.5.13
| +--- io.swagger:swagger-jaxrs:1.5.13
| | +--- com.fasterxml.jackson.core:jackson-databind:2.8.5 (*)
| | +--- io.swagger:swagger-core:1.5.13
| | | +--- org.apache.commons:commons-lang3:3.2.1
| | | +--- org.slf4j:slf4j-api:1.7.22
| | | +--- com.fasterxml.jackson.core:jackson-annotations:2.8.5
| | | +--- com.fasterxml.jackson.core:jackson-databind:2.8.5 (*)
| | | +--- com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.8.5
| | | | +--- com.fasterxml.jackson.core:jackson-core:2.8.5
| | | | \--- org.yaml:snakeyaml:1.17
| | | +--- io.swagger:swagger-models:1.5.13
| | | | +--- com.fasterxml.jackson.core:jackson-annotations:2.8.5
| | | | +--- org.slf4j:slf4j-api:1.7.22
| | | | \--- io.swagger:swagger-annotations:1.5.13
| | | +--- com.google.guava:guava:20.0
| | | \--- javax.validation:validation-api:1.1.0.Final
| | +--- org.reflections:reflections:0.9.10 (*)
| | \--- com.google.guava:guava:20.0
| +--- com.sun.jersey.contribs:jersey-multipart:1.13
| | +--- org.jvnet:mimepull:1.6
| | \--- com.sun.jersey:jersey-core:1.13
| \--- com.sun.jersey:jersey-core:1.13
+--- javax.servlet:javax.servlet-api:4.0.0-b05
+--- org.springframework:spring-core:4.3.8.RELEASE (*)
+--- org.springframework:spring-web:4.3.8.RELEASE (*)
+--- org.springframework.security:spring-security-web:4.2.2.RELEASE (*)
+--- org.springframework.security:spring-security-config:4.2.2.RELEASE (*)
+--- org.glassfish.jersey.core:jersey-client:2.25.1 (*)
+--- org.glassfish.jersey.core:jersey-server:2.25.1 (*)
+--- org.glassfish.jersey.core:jersey-common:2.25.1 (*)
+--- org.glassfish.jersey.containers:jersey-container-servlet:2.25.1 (*)
+--- com.google.code.gson:gson:2.8.0
+--- org.glassfish.jersey.media:jersey-media-json-jackson:2.25.1 (*)
+--- org.hibernate:hibernate-core:5.2.10.Final (*)
+--- mysql:mysql-connector-java:5.1.39
+--- org.apache.httpcomponents:httpclient:4.3.4 (*)
+--- commons-httpclient:commons-httpclient:3.1 (*)
+--- org.apache.logging.log4j:log4j-api:2.7
\--- org.apache.logging.log4j:log4j-core:2.7 (*)
的build.gradle
group 'se.mulander.scraper'
version '1.0-SNAPSHOT'
apply plugin: 'java'
apply plugin: 'war'
sourceCompatibility = 1.8
repositories {
mavenCentral()
maven {
url '../maven'
}
}
dependencies {
testCompile group: 'junit', name: 'junit', version: '4.11'
testCompile group: 'com.mscharhag.oleaster', name: 'oleaster-matcher', version: '0.1.2'
testCompile group: 'com.mscharhag.oleaster', name: 'oleaster-runner', version: '0.1.2'
testCompile group: 'org.powermock', name: 'powermock-module-junit4', version: '1.6.6'
testCompile group: 'org.powermock', name: 'powermock-api-mockito', version: '1.6.6'
testCompile group: 'org.powermock', name: 'powermock-module-junit4-rule', version: '1.6.6'
compile('com.wordnik:swagger-jaxrs_2.10:1.3.13') {
exclude group: 'javax.ws.rs'
}
compile group: 'javax.ws.rs', name: 'javax.ws.rs-api', version: '2.1-m09'
compile group: 'javax.servlet', name: 'javax.servlet-api', version: '4.0.0-b05'
compile group: 'org.springframework', name: 'spring-core', version: '4.3.8.RELEASE'
compile group: 'org.springframework', name: 'spring-web', version: '4.3.8.RELEASE'
compile group: 'org.springframework.security', name: 'spring-security-web', version: '4.2.2.RELEASE'
compile group: 'org.springframework.security', name: 'spring-security-config', version: '4.2.2.RELEASE'
compile group: 'org.glassfish.jersey.core', name: 'jersey-client', version: '2.25.1'
compile group: 'org.glassfish.jersey.core', name: 'jersey-server', version: '2.25.1'
compile group: 'org.glassfish.jersey.core', name: 'jersey-common', version: '2.25.1'
compile group: 'org.glassfish.jersey.containers', name: 'jersey-container-servlet', version: '2.25.1'
compile group: 'com.google.code.gson', name: 'gson', version: '2.8.0'
compile group: 'org.glassfish.jersey.media', name: 'jersey-media-json-jackson', version: '2.25.1'
compile group: 'org.hibernate', name: 'hibernate-core', version: '5.2.9.Final'
compile group: 'mysql', name: 'mysql-connector-java', version: '5.1.39'
compile group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.3.4'
compile group: 'commons-httpclient', name: 'commons-httpclient', version: '3.1'
compile group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.7'
compile group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.7'
compile('se.mulander.cosmos:common:1.1'){
exclude group: 'javax.ws.rs'
}
}
war {
destinationDir(file('build/'))
}