0

I'm trying to extract my Google Sheet information from my Spring Boot application, but I got the error

Exception in thread "main" java.lang.NoSuchMethodError: 'long com.google.common.io.ByteStreams.exhaust(java.io.InputStream)'

I already added all the necessary dependencies I think I need and I'm still getting the error when I run my program.

Some of the dependencies that I am using are these ones:

google-oauth-client
google-oauth-client-java
google-oauth-client-jetty
google-api-client
google-http-client
google-http-client-jackson2
google-api-services-sheets-v4

My biggest doubt is that when I use the same code in a Maven project, it runs successfully. But when I try to integrate the same code in a Spring Boot project I got the previous error. So, why?

3

1 Answer 1

0

You can explore dependency hierarchy of your pom.xml and find which dependency is overriding com.google.common.io groupid, when you are working with spring boot project. And then exclude that specific dependency.

Similar solution you can find in below question. Here is the link: Refer this

Sign up to request clarification or add additional context in comments.

Comments