Closed santhh closed 6 years ago
java.lang.NoClassDefFoundError: org/threeten/bp/Duration
There is no particular dependency in your classpath. I have no idea what is as a transitive one from now because I am on the phone, but you definitely can find it in Maven and add it explicitly in your project.
On the other hand that would be great to see your project to let us to reproduce the issue. That indeed might not be a surprise that some dependency is lost for PubSub implementation during the recent upgrade.
Please, come back to us with more information.
@artembilan Thanks for looking into this in such short notice. Even if I add the dependency in the maven, it gives no class def for some other reason. At the end I added quite a few of them to test out but stopped when I got no def for some IAM related class. Here is my POM.xml. My project is a big data related project, just wanted to see if i could stream some data to a topic. ..
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.9.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>1.8</java.version>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
How dose it work if you add this dependency?
<dependency>
<groupId>org.threeten</groupId>
<artifactId>threetenbp</artifactId>
<version>1.3.3</version>
<scope>compile</scope>
<exclusions>
<exclusion>
<artifactId>guava-jdk5</artifactId>
<groupId>com.google.guava</groupId>
</exclusion>
</exclusions>
</dependency>
?
Would you mind also do share with us the result of the dependency:tree
report for your project?
mvn dependency:tree
should indeed help, since at the time M1 was released, we still weren't using anything from org.threeten.threetenbp
.
Thank you, @joaoandremartins , for confirmation.
So, my local report against current master
shows:
[INFO] +- org.springframework.cloud:spring-cloud-gcp-pubsub:jar:1.0.0.BUILD-SNAPSHOT:compile
[INFO] | +- com.google.cloud:google-cloud-pubsub:jar:0.32.0-beta:compile
...
[INFO] | +- org.springframework:spring-messaging:jar:4.3.11.RELEASE:compile
...
[INFO] | \- com.google.api:gax:jar:1.15.0:compile
...
[INFO] | +- org.threeten:threetenbp:jar:1.3.3:compile
That says that threetenbp
is a transitive dependency of the gax
. And I really see this one in the M1 pom as well: repo.spring.io/libs-milestone/org/springframework/cloud/spring-cloud-gcp-pubsub/1.0.0.M1/spring-cloud-gcp-pubsub-1.0.0.M1.pom.
So, confusing...
Thanks @artembilan @joaoandremartins
Added the dependancy but still the same error.
here is the dependency tree in my project:
[INFO] --- maven-dependency-plugin:2.10:tree (default-cli) @ soda-chicago-traffic-data-ingest ---
[INFO] Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/shared/maven-dependency-analyzer/1.6/maven-dependency-analyzer-1.6.pom
[INFO] Downloaded: https://repo.maven.apache.org/maven2/org/apache/maven/shared/maven-dependency-analyzer/1.6/maven-dependency-analyzer-1.6.pom (6 KB at 85.8 KB/sec)
[INFO] Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/shared/maven-invoker/2.1.1/maven-invoker-2.1.1.pom
[INFO] Downloaded: https://repo.maven.apache.org/maven2/org/apache/maven/shared/maven-invoker/2.1.1/maven-invoker-2.1.1.pom (6 KB at 89.1 KB/sec)
[INFO] Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/shared/maven-dependency-analyzer/1.6/maven-dependency-analyzer-1.6.jar
[INFO] Downloaded: https://repo.maven.apache.org/maven2/org/apache/maven/shared/maven-dependency-analyzer/1.6/maven-dependency-analyzer-1.6.jar (31 KB at 427.3 KB/sec)
[INFO] Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/shared/maven-invoker/2.1.1/maven-invoker-2.1.1.jar
[INFO] Downloaded: https://repo.maven.apache.org/maven2/org/apache/maven/shared/maven-invoker/2.1.1/maven-invoker-2.1.1.jar (30 KB at 427.0 KB/sec)
[INFO] com.gcp.containers:soda-chicago-traffic-data-ingest:jar:0.0.1-SNAPSHOT
[INFO] +- org.springframework.cloud:spring-integration-gcp:jar:1.0.0.M1:compile
[INFO] | +- org.springframework.integration:spring-integration-core:jar:4.3.12.RELEASE:compile
[INFO] | | +- org.springframework:spring-aop:jar:4.3.13.RELEASE:compile
[INFO] | | +- org.springframework:spring-context:jar:4.3.13.RELEASE:compile
[INFO] | | +- org.springframework:spring-messaging:jar:4.3.13.RELEASE:compile
[INFO] | | +- org.springframework:spring-tx:jar:4.3.13.RELEASE:compile
[INFO] | | \- org.springframework.retry:spring-retry:jar:1.2.1.RELEASE:compile
[INFO] | \- org.slf4j:slf4j-api:jar:1.7.25:compile
[INFO] +- org.springframework.cloud:spring-cloud-gcp-starter-pubsub:jar:1.0.0.M1:compile
[INFO] | \- org.springframework.cloud:spring-cloud-gcp-pubsub:jar:1.0.0.M1:compile
[INFO] | +- com.google.cloud:google-cloud-pubsub:jar:0.26.0-beta:compile
[INFO] | | +- io.netty:netty-tcnative-boringssl-static:jar:2.0.3.Final:compile
[INFO] | | +- com.google.cloud:google-cloud-core-grpc:jar:1.8.0:compile
[INFO] | | | +- com.google.protobuf:protobuf-java:jar:3.3.1:compile
[INFO] | | | +- io.grpc:grpc-protobuf:jar:1.6.1:compile
[INFO] | | | | \- io.grpc:grpc-protobuf-lite:jar:1.6.1:compile
[INFO] | | | +- io.grpc:grpc-context:jar:1.6.1:compile
[INFO] | | | \- com.google.api:gax-grpc:jar:0.26.0:compile
[INFO] | | +- com.google.api.grpc:proto-google-cloud-pubsub-v1:jar:0.1.21:compile
[INFO] | | +- com.google.api.grpc:grpc-google-cloud-pubsub-v1:jar:0.1.21:compile
[INFO] | | +- io.grpc:grpc-netty:jar:1.6.1:compile
[INFO] | | | +- io.grpc:grpc-core:jar:1.6.1:compile (version selected from constraint [1.6.1,1.6.1])
[INFO] | | | | +- com.google.errorprone:error_prone_annotations:jar:2.0.19:compile
[INFO] | | | | +- com.google.instrumentation:instrumentation-api:jar:0.4.3:compile
[INFO] | | | | \- io.opencensus:opencensus-api:jar:0.5.1:compile
[INFO] | | | +- io.netty:netty-codec-http2:jar:4.1.14.Final:compile (version selected from constraint [4.1.14.Final,4.1.14.Final])
[INFO] | | | | +- io.netty:netty-codec-http:jar:4.1.14.Final:compile
[INFO] | | | | | \- io.netty:netty-codec:jar:4.1.14.Final:compile
[INFO] | | | | \- io.netty:netty-handler:jar:4.1.14.Final:compile
[INFO] | | | | \- io.netty:netty-buffer:jar:4.1.14.Final:compile
[INFO] | | | | \- io.netty:netty-common:jar:4.1.14.Final:compile
[INFO] | | | \- io.netty:netty-handler-proxy:jar:4.1.14.Final:compile
[INFO] | | | +- io.netty:netty-transport:jar:4.1.14.Final:compile
[INFO] | | | | \- io.netty:netty-resolver:jar:4.1.14.Final:compile
[INFO] | | | \- io.netty:netty-codec-socks:jar:4.1.14.Final:compile
[INFO] | | +- io.grpc:grpc-stub:jar:1.6.1:compile
[INFO] | | \- io.grpc:grpc-auth:jar:1.6.1:compile
[INFO] | \- com.google.api:gax:jar:1.9.0:compile
[INFO] | +- com.google.auto.value:auto-value:jar:1.2:compile
[INFO] | +- com.google.code.findbugs:jsr305:jar:3.0.0:compile
[INFO] | +- com.google.guava:guava:jar:20.0:compile
[INFO] | \- com.google.api:api-common:jar:1.1.0:compile
[INFO] +- org.springframework.boot:spring-boot-starter-data-rest:jar:1.5.9.RELEASE:compile
[INFO] | +- org.springframework.boot:spring-boot-starter:jar:1.5.9.RELEASE:compile
[INFO] | | +- org.springframework.boot:spring-boot:jar:1.5.9.RELEASE:compile
[INFO] | | +- org.springframework.boot:spring-boot-starter-logging:jar:1.5.9.RELEASE:compile
[INFO] | | | +- ch.qos.logback:logback-classic:jar:1.1.11:compile
[INFO] | | | | \- ch.qos.logback:logback-core:jar:1.1.11:compile
[INFO] | | | +- org.slf4j:jul-to-slf4j:jar:1.7.25:compile
[INFO] | | | \- org.slf4j:log4j-over-slf4j:jar:1.7.25:compile
[INFO] | | \- org.yaml:snakeyaml:jar:1.17:runtime
[INFO] | +- com.fasterxml.jackson.core:jackson-annotations:jar:2.8.0:compile
[INFO] | \- org.springframework.data:spring-data-rest-webmvc:jar:2.6.9.RELEASE:compile
[INFO] | +- org.springframework.data:spring-data-rest-core:jar:2.6.9.RELEASE:compile
[INFO] | | +- org.springframework.hateoas:spring-hateoas:jar:0.23.0.RELEASE:compile
[INFO] | | +- org.springframework.data:spring-data-commons:jar:1.13.9.RELEASE:compile
[INFO] | | +- org.springframework.plugin:spring-plugin-core:jar:1.2.0.RELEASE:compile
[INFO] | | \- org.atteo:evo-inflector:jar:1.2.2:compile
[INFO] | \- org.slf4j:jcl-over-slf4j:jar:1.7.25:compile
[INFO] +- org.springframework.boot:spring-boot-starter-web:jar:1.5.9.RELEASE:compile
[INFO] | +- org.springframework.boot:spring-boot-starter-tomcat:jar:1.5.9.RELEASE:compile
[INFO] | | +- org.apache.tomcat.embed:tomcat-embed-core:jar:8.5.23:compile
[INFO] | | | \- org.apache.tomcat:tomcat-annotations-api:jar:8.5.23:compile
[INFO] | | +- org.apache.tomcat.embed:tomcat-embed-el:jar:8.5.23:compile
[INFO] | | \- org.apache.tomcat.embed:tomcat-embed-websocket:jar:8.5.23:compile
[INFO] | +- org.hibernate:hibernate-validator:jar:5.3.6.Final:compile
[INFO] | | +- javax.validation:validation-api:jar:1.1.0.Final:compile
[INFO] | | +- org.jboss.logging:jboss-logging:jar:3.3.1.Final:compile
[INFO] | | \- com.fasterxml:classmate:jar:1.3.4:compile
[INFO] | +- org.springframework:spring-web:jar:4.3.13.RELEASE:compile
[INFO] | | \- org.springframework:spring-beans:jar:4.3.13.RELEASE:compile
[INFO] | \- org.springframework:spring-webmvc:jar:4.3.13.RELEASE:compile
[INFO] | \- org.springframework:spring-expression:jar:4.3.13.RELEASE:compile
[INFO] +- org.springframework.cloud:spring-cloud-gcp-starter-core:jar:1.0.0.M1:compile
[INFO] | +- org.springframework.cloud:spring-cloud-gcp-core:jar:1.0.0.M1:compile
[INFO] | | \- com.google.cloud:google-cloud-core:jar:1.2.3:compile
[INFO] | | +- joda-time:joda-time:jar:2.9.9:compile
[INFO] | | +- org.json:json:jar:20140107:compile
[INFO] | | +- com.google.protobuf:protobuf-java-util:jar:3.3.0:compile
[INFO] | | | \- com.google.code.gson:gson:jar:2.8.2:compile
[INFO] | | +- com.google.api.grpc:proto-google-common-protos:jar:0.1.13:compile
[INFO] | | \- com.google.api.grpc:proto-google-iam-v1:jar:0.1.13:compile
[INFO] | +- commons-logging:commons-logging:jar:1.2:compile
[INFO] | +- com.google.auth:google-auth-library-oauth2-http:jar:0.7.1:compile
[INFO] | | +- com.google.auth:google-auth-library-credentials:jar:0.7.1:compile
[INFO] | | +- com.google.http-client:google-http-client:jar:1.19.0:compile
[INFO] | | | \- org.apache.httpcomponents:httpclient:jar:4.5.3:compile
[INFO] | | | +- org.apache.httpcomponents:httpcore:jar:4.4.8:compile
[INFO] | | | \- commons-codec:commons-codec:jar:1.10:compile
[INFO] | | \- com.google.http-client:google-http-client-jackson2:jar:1.19.0:compile
[INFO] | \- org.springframework.boot:spring-boot-autoconfigure:jar:1.5.9.RELEASE:compile
[INFO] +- org.springframework.boot:spring-boot-starter-test:jar:1.5.9.RELEASE:test
[INFO] | +- org.springframework.boot:spring-boot-test:jar:1.5.9.RELEASE:test
[INFO] | +- org.springframework.boot:spring-boot-test-autoconfigure:jar:1.5.9.RELEASE:test
[INFO] | +- com.jayway.jsonpath:json-path:jar:2.2.0:test
[INFO] | | \- net.minidev:json-smart:jar:2.2.1:test
[INFO] | | \- net.minidev:accessors-smart:jar:1.1:test
[INFO] | | \- org.ow2.asm:asm:jar:5.0.3:test
[INFO] | +- junit:junit:jar:4.12:test
[INFO] | +- org.assertj:assertj-core:jar:2.6.0:test
[INFO] | +- org.mockito:mockito-core:jar:1.10.19:test
[INFO] | | \- org.objenesis:objenesis:jar:2.1:test
[INFO] | +- org.hamcrest:hamcrest-core:jar:1.3:test
[INFO] | +- org.hamcrest:hamcrest-library:jar:1.3:test
[INFO] | +- org.skyscreamer:jsonassert:jar:1.4.0:test
[INFO] | | \- com.vaadin.external.google:android-json:jar:0.0.20131108.vaadin1:test
[INFO] | +- org.springframework:spring-core:jar:4.3.13.RELEASE:compile
[INFO] | \- org.springframework:spring-test:jar:4.3.13.RELEASE:test
[INFO] +- com.fasterxml.jackson.core:jackson-databind:jar:2.8.10:compile
[INFO] | \- com.fasterxml.jackson.core:jackson-core:jar:2.8.10:compile
[INFO] \- org.threeten:threetenbp:jar:1.3.3:compile
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.489 s
[INFO] Finished at: 2018-01-16T10:59:05-05:00
[INFO] Final Memory: 29M/322M
Added the dependancy but still the same error.
That's impossible since we have org.threeten.bp.Duration
in the classpath.
Indeed your report doesn't show threetenbp
transitive dependency on the gax
, but at the same time I see it as a direct dependency. Strange...
@santhh thanks for your response.
I know you've pasted bits of your pom.xml
but, at this point, I'd like to request for the whole pom.xml
if that's possible.
I'd like to be able to reproduce the issue you're seeing locally.
+1 for @joaoandremartins comment. And that's why I even asked to share with us some simple Spring Boot project to let us to play locally.
There is Getting Started Guide on the matter though and the project has a particular sample as well.
Closing for the time being. Feel free to reopen if you see the issue again.
Hello: Any idea about this error below? I keep getting this when tried a sample project for spring boot + GCP pub sub. Pretty much tried everything I could do so far. Any help is appreciated.