ThreeTen / threetenbp

Backport of functionality based on JSR-310 to Java SE 6 and 7. This is NOT an implementation of JSR-310.
http://www.threeten.org/threetenbp/
BSD 3-Clause "New" or "Revised" License
553 stars 139 forks source link

java.lang.ClassNotFoundException: org.threeten.bp.temporal.TemporalAccessor #126

Closed arthurgwatidzo closed 4 years ago

arthurgwatidzo commented 4 years ago

I am using threetenbp version 1.4.4 in my maven project. On deploying my JAR in a tomcat container, I get the error/exception below: java.lang.NoClassDefFoundError: org/threeten/bp/temporal/TemporalAccessor caused by Caused by: java.lang.ClassNotFoundException: org.threeten.bp.temporal.TemporalAccessor. What is the root cause and solution to this issue? I even tried bumping up or down the version for threeten bp JAR and its not resolving the issue My MAVEN dependencies are =>

junit junit 4.11 test javax.servlet javax.servlet-api 3.1.0 provided org.glassfish.jersey.core jersey-server ${jersey.version} org.glassfish.jersey.containers jersey-container-servlet ${jersey.version} org.glassfish.jersey.media jersey-media-moxy ${jersey.version} org.glassfish.jersey.inject jersey-hk2 ${jersey.version} com.fasterxml.jackson.core jackson-annotations 2.9.8 org.glassfish.jersey.core jersey-client ${jersey.version} io.jsonwebtoken jjwt 0.9.1 javax.xml.bind jaxb-api 2.3.1 com.google.code.gson gson 2.8.1 io.gsonfire gson-fire 1.8.3 com.auth0 java-jwt 3.9.0 org.bouncycastle bcprov-jdk15on 1.53 org.bouncycastle bcpkix-jdk15on 1.53 commons-io commons-io 2.6 io.swagger swagger-annotations 1.5.18 com.squareup.okhttp okhttp 2.7.5 com.squareup.okhttp logging-interceptor 2.7.5 org.threeten threetenbp 1.3.5 org.aspectj aspectjrt 1.9.0 openconnector openconnector 1.0 commons-logging commons-logging 1.2 net.sf.flexjson flexjson 3.3 sailpoint.integration iiqIntegration-1.0 1.0 sailpoint.identityiq identityiq 1.0 log4j log4j 1.2.17

My maven dependency tree is below ( I dont see any transitive dependency) linked to this dependency => [INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ hass-consumer --- [INFO]aa.aaa.aaaa: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

jodastephen commented 4 years ago

I suggest asking at Stack Overflow. As I'm not a Tomcat user, I can't help you with setup there.

arthurgwatidzo commented 4 years ago

Managed to fix the issue by copying the same threetenbp-X.X.X.jar into tomcat lib directory and the WEB-INF/lib directory for the unpacked WAR file deployed in Tomcat container. Thank you