NoSuchMethod error getting a gdata service

前端 未结 8 844
时光说笑
时光说笑 2020-12-09 14:06

I get the following error:

Exception in thread \"main\" java.lang.NoSuchMethodError: com.google.common.collect.ImmutableSet.of([Ljava/lang/Object;)Lcom/googl         


        
8条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-09 14:43

    It could be that some of your jars would be having dependency on google/guava jars and if they're not in build path or if multiple of them are there it might raise inconsistency hence the error. A quick solution could be add latest version of guava to your pom

     
            com.google.guava
            guava
            24.0-jre
        
    

    Now check in dependency hierarchy if any of your Jar apart from guava is referring to any other older jar of guava/google-collections. If so then exclude it, something like this

    
                
                    com.google.collections
                    google-collections
                
     
    

提交回复
热议问题