我在我的Maven项目中使用Threetenbp版本1.4.4。在tomcat容器中部署JAR时,出现以下异常:


  java.lang.NoClassDefFoundError:
  “ org / threeten / bp / temporal / TemporalAccessor”由以下原因引起:
  “ java.lang.ClassNotFoundException:
  org.threeten.bp.temporal.TemporalAccessor”。


...此问题的根本原因和解决方案是什么?
    (注意:目前在该平台上针对同一问题发布的建议解决方案尚未解决我的问题)。
    我什至尝试提高或降低JAR版本,但无法解决问题

My maven dependency tree is below ( I do not see any transitive dependency) linked to this dependency

[INFO] aa.aa.aaa.aaa.hass:hass-consumer:jar:1.0
[INFO] +- junit:junit:jar:4.11:test
[INFO] |  \- org.hamcrest:hamcrest-core:jar:1.3:test
[INFO] +- javax.servlet:javax.servlet-api:jar:3.1.0:provided
[INFO] +- org.glassfish.jersey.core:jersey-server:jar:2.26:compile
[INFO] |  +- org.glassfish.jersey.core:jersey-common:jar:2.26:compile
[INFO] |  |  \- org.glassfish.hk2:osgi-resource-locator:jar:1.0.1:compile
[INFO] |  +- javax.ws.rs:javax.ws.rs-api:jar:2.1:compile
[INFO] |  +- org.glassfish.jersey.media:jersey-media-jaxb:jar:2.26:compile
[INFO] |  +- javax.annotation:javax.annotation-api:jar:1.2:compile
[INFO] |  +- org.glassfish.hk2.external:javax.inject:jar:2.5.0-b42:compile
[INFO] |  \- javax.validation:validation-api:jar:1.1.0.Final:compile
[INFO] +- org.glassfish.jersey.containers:jersey-container-servlet:jar:2.26:compile
[INFO] |  \- org.glassfish.jersey.containers:jersey-container-servlet-core:jar:2.26:compile
[INFO] +- org.glassfish.jersey.media:jersey-media-moxy:jar:2.26:compile
[INFO] |  +- org.glassfish.jersey.ext:jersey-entity-filtering:jar:2.26:compile
[INFO] |  \- org.eclipse.persistence:org.eclipse.persistence.moxy:jar:2.6.4:compile
[INFO] |     +- org.eclipse.persistence:org.eclipse.persistence.core:jar:2.6.4:compile
[INFO] |     |  \- org.eclipse.persistence:org.eclipse.persistence.asm:jar:2.6.4:compile
[INFO] |     \- org.glassfish:javax.json:jar:1.0.4:compile
[INFO] +- org.glassfish.jersey.inject:jersey-hk2:jar:2.26:compile
[INFO] |  \- org.glassfish.hk2:hk2-locator:jar:2.5.0-b42:compile
[INFO] |     +- org.glassfish.hk2.external:aopalliance-repackaged:jar:2.5.0-b42:compile
[INFO] |     +- org.glassfish.hk2:hk2-api:jar:2.5.0-b42:compile
[INFO] |     |  \- javax.inject:javax.inject:jar:1:compile
[INFO] |     +- org.glassfish.hk2:hk2-utils:jar:2.5.0-b42:compile
[INFO] |     \- org.javassist:javassist:jar:3.22.0-CR2:compile
[INFO] +- com.fasterxml.jackson.core:jackson-annotations:jar:2.9.8:compile
[INFO] +- org.glassfish.jersey.core:jersey-client:jar:2.26:compile
[INFO] +- io.jsonwebtoken:jjwt:jar:0.9.1:compile
[INFO] |  \- com.fasterxml.jackson.core:jackson-databind:jar:2.9.6:compile
[INFO] |     \- com.fasterxml.jackson.core:jackson-core:jar:2.9.6:compile
[INFO] +- javax.xml.bind:jaxb-api:jar:2.3.1:compile
[INFO] |  \- javax.activation:javax.activation-api:jar:1.2.0:compile
[INFO] +- com.google.code.gson:gson:jar:2.8.1:compile
[INFO] +- io.gsonfire:gson-fire:jar:1.8.3:compile
[INFO] +- com.auth0:java-jwt:jar:3.9.0:compile
[INFO] |  \- commons-codec:commons-codec:jar:1.12:runtime
[INFO] +- org.bouncycastle:bcprov-jdk15on:jar:1.53:compile
[INFO] +- org.bouncycastle:bcpkix-jdk15on:jar:1.53:compile
[INFO] +- commons-io:commons-io:jar:2.6:compile
[INFO] +- io.swagger:swagger-annotations:jar:1.5.18:compile
[INFO] +- com.squareup.okhttp:okhttp:jar:2.7.5:compile
[INFO] |  \- com.squareup.okio:okio:jar:1.6.0:compile
[INFO] +- com.squareup.okhttp:logging-interceptor:jar:2.7.5:compile
[INFO] +- org.threeten:threetenbp:jar:1.3.5:compile
[INFO] +- org.aspectj:aspectjrt:jar:1.9.0:compile
[INFO] +- openconnector:openconnector:jar:1.0:compile
[INFO] +- commons-logging:commons-logging:jar:1.2:compile
[INFO] +- net.sf.flexjson:flexjson:jar:3.3:compile
[INFO] +- sailpoint.integration:iiqIntegration-1.0:jar:1.0:compile
[INFO] +- sailpoint.identityiq:identityiq:jar:1.0:compile
[INFO] \- log4j:log4j:jar:1.2.17:compile"

最佳答案

请在Tomcat服务器类路径或Tomcat的库文件夹中添加threetenbp-1.3.5.jar

10-08 13:44