Re: adwords-axis-2.8.0.jar transitive dependencies cause Caused by: java.lang.ClassCastException: com.google.common.io.ByteSource$ByteArrayByteSource cannot be cast to com.google.common.io.InputSuppli

2015-12-28 Thread Andy Lin
Yes, it works after I excluded guava-jdk5-#.jar from all the google api. 
 My project also use google drive, oauth-client, and api-clients.  Some of 
these have the transitive dependency on guava-jdk5-#.jar

This is a example how I did it.

compile('com.google.api-client:google-api-client:1.20.0'){

exclude group: 'com.google.guava', module: 'guava-jdk5' 

}

compile('com.google.oauth-client:google-oauth-client-jetty:1.20.0'){

exclude group: 'com.google.guava', module: 'guava-jdk5' 

}

compile('com.google.apis:google-api-services-drive:v2-rev170-1.20.0'){

exclude group: 'com.google.guava', module: 'guava-jdk5' 

}

On Monday, December 14, 2015 at 8:58:24 AM UTC-5, Andy Lin wrote:
>
> In my build.gradle, I have those 2 adword api jars as dependencies, when I 
> pool the results from the batchJobs, I get the following execptions, which 
> versions of guava-#.jar and guava-jdk5-#.jar I should explicit specify in 
> my build.gradle?  It seems like transitive jar dependencies' version 
> conflict problems.  thanks for your answer
>
> compile('com.google.api-ads:ads-lib:2.8.0')
> compile('com.google.api-ads:adwords-axis:2.8.0')
>
>  if (batchJob.getDownloadUrl() != null && 
> batchJob.getDownloadUrl().getUrl() != null) {
> BatchJobMutateResponse mutateResponse =
> 
> batchJobHelper.downloadBatchJobMutateResponse(batchJob.getDownloadUrl().getUrl());
> System.out.printf("Downloaded results from %s:%n", 
> batchJob.getDownloadUrl().getUrl());
> for (MutateResult mutateResult : 
> mutateResponse.getMutateResults()) {
>   String outcome = mutateResult.getErrorList() == null ? 
> "SUCCESS" : "FAILURE";
>   System.out.printf("  Operation [%d] - %s%n", 
> mutateResult.getIndex(), outcome);
> }
>   }
>  
>
>
> Caused by: java.lang.ClassCastException: 
> com.google.common.io.ByteSource$ByteArrayByteSource cannot be cast to 
> com.google.common.io.InputSupplier
> at 
> com.google.common.io.MultiInputStream.advance(MultiInputStream.java:65) 
> ~[guava-jdk5-13.0.jar:na]
> at 
> com.google.common.io.MultiInputStream.(MultiInputStream.java:44) 
> ~[guava-jdk5-13.0.jar:na]
> at 
> com.google.common.io.ByteSource$ConcatenatedByteSource.openStream(ByteSource.java:653)
>  
> ~[guava-19.0-rc2.jar:na]
> at 
> com.google.api.ads.adwords.axis.utils.AxisDeserializer.buildWrappedInputStream(AxisDeserializer.java:160)
>  
> ~[adwords-axis-2.8.0.jar:na]
> at 
> com.google.api.ads.adwords.axis.utils.AxisDeserializer.deserializeBatchJobMutateResults(AxisDeserializer.java:113)
>  
> ~[adwords-axis-2.8.0.jar:na]
> at 
> com.google.api.ads.adwords.axis.utils.v201509.batchjob.BatchJobHelper.downloadBatchJobMutateResponse(BatchJobHelper.java:101)
>  
> ~[adwords-axis-2.8.0.jar:na]
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/92ae31b8-1e89-46ee-9e18-fd53dbbe43db%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: adwords-axis-2.8.0.jar transitive dependencies cause Caused by: java.lang.ClassCastException: com.google.common.io.ByteSource$ByteArrayByteSource cannot be cast to com.google.common.io.InputSuppli

2015-12-14 Thread Josh Radcliff (AdWords API Team)
Hi,

I would recommend *not* including the guava-jdk5 dependency in gradle. As 
announced 
in November of last year 
,
 
the minimum JRE version required for the library is 1.6, so the Java 5 
backport shouldn't be required, and may actually cause problems.

For the com.google.guava/guava dependency, I'd recommend using 19.0-rc2 
(the version referenced in the ads_lib pom.xml 

).

Thanks,
Josh, AdWords API Team

On Monday, December 14, 2015 at 8:58:24 AM UTC-5, Andy Lin wrote:
>
> In my build.gradle, I have those 2 adword api jars as dependencies, when I 
> pool the results from the batchJobs, I get the following execptions, which 
> versions of guava-#.jar and guava-jdk5-#.jar I should explicit specify in 
> my build.gradle?  It seems like transitive jar dependencies' version 
> conflict problems.  thanks for your answer
>
> compile('com.google.api-ads:ads-lib:2.8.0')
> compile('com.google.api-ads:adwords-axis:2.8.0')
>
>  if (batchJob.getDownloadUrl() != null && 
> batchJob.getDownloadUrl().getUrl() != null) {
> BatchJobMutateResponse mutateResponse =
> 
> batchJobHelper.downloadBatchJobMutateResponse(batchJob.getDownloadUrl().getUrl());
> System.out.printf("Downloaded results from %s:%n", 
> batchJob.getDownloadUrl().getUrl());
> for (MutateResult mutateResult : 
> mutateResponse.getMutateResults()) {
>   String outcome = mutateResult.getErrorList() == null ? 
> "SUCCESS" : "FAILURE";
>   System.out.printf("  Operation [%d] - %s%n", 
> mutateResult.getIndex(), outcome);
> }
>   }
>  
>
>
> Caused by: java.lang.ClassCastException: 
> com.google.common.io.ByteSource$ByteArrayByteSource cannot be cast to 
> com.google.common.io.InputSupplier
> at 
> com.google.common.io.MultiInputStream.advance(MultiInputStream.java:65) 
> ~[guava-jdk5-13.0.jar:na]
> at 
> com.google.common.io.MultiInputStream.(MultiInputStream.java:44) 
> ~[guava-jdk5-13.0.jar:na]
> at 
> com.google.common.io.ByteSource$ConcatenatedByteSource.openStream(ByteSource.java:653)
>  
> ~[guava-19.0-rc2.jar:na]
> at 
> com.google.api.ads.adwords.axis.utils.AxisDeserializer.buildWrappedInputStream(AxisDeserializer.java:160)
>  
> ~[adwords-axis-2.8.0.jar:na]
> at 
> com.google.api.ads.adwords.axis.utils.AxisDeserializer.deserializeBatchJobMutateResults(AxisDeserializer.java:113)
>  
> ~[adwords-axis-2.8.0.jar:na]
> at 
> com.google.api.ads.adwords.axis.utils.v201509.batchjob.BatchJobHelper.downloadBatchJobMutateResponse(BatchJobHelper.java:101)
>  
> ~[adwords-axis-2.8.0.jar:na]
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/7cda0206-98c0-430a-b9ef-446d4110b062%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.