CampaignServiceInterface get method is broken upgrading Java SDK jar from v2.12.0 to 2.13.0

149 views
Skip to first unread message

Han Vo

unread,
May 31, 2016, 5:50:58 PM5/31/16
to AdWords API Forum
Everything is still working at 2.12.0, but upgrading to 2.13.0 (even without upgrading the api version) breaks my application while using CampaignServiceInterface get method. This also breaks for every version after 2.13.0 (including 2.14.0 and 2.15.0). Please advise and here is the full stack:

Exception in thread "main" java.lang.ExceptionInInitializerError
at com.google.api.ads.adwords.lib.AdWordsModule.getInternals(AdWordsModule.java:61)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at com.google.inject.internal.ProviderMethod$ReflectionProviderMethod.doProvision(ProviderMethod.java:299)
at com.google.inject.internal.ProviderMethod.get(ProviderMethod.java:172)
at com.google.inject.internal.ProviderInternalFactory.provision(ProviderInternalFactory.java:81)
at com.google.inject.internal.InternalFactoryToInitializableAdapter.provision(InternalFactoryToInitializableAdapter.java:53)
at com.google.inject.internal.ProviderInternalFactory.circularGet(ProviderInternalFactory.java:61)
at com.google.inject.internal.InternalFactoryToInitializableAdapter.get(InternalFactoryToInitializableAdapter.java:45)
at com.google.inject.internal.InjectorImpl$2$1.call(InjectorImpl.java:1016)
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1092)
at com.google.inject.internal.InjectorImpl$2.get(InjectorImpl.java:1012)
at com.google.api.ads.common.lib.useragent.AdsUtilitiesUserAgentProvider.getUserAgent(AdsUtilitiesUserAgentProvider.java:57)
at com.google.api.ads.common.lib.useragent.UserAgentCombiner$1.apply(UserAgentCombiner.java:90)
at com.google.api.ads.common.lib.useragent.UserAgentCombiner$1.apply(UserAgentCombiner.java:87)
at com.google.common.collect.Iterators$9.transform(Iterators.java:879)
at com.google.common.collect.TransformedIterator.next(TransformedIterator.java:46)
at com.google.common.base.Joiner$2.appendTo(Joiner.java:309)
at com.google.common.base.Joiner.appendTo(Joiner.java:184)
at com.google.common.base.Joiner.join(Joiner.java:240)
at com.google.common.base.Joiner.join(Joiner.java:230)
at com.google.api.ads.common.lib.useragent.UserAgentCombiner.getUserAgent(UserAgentCombiner.java:86)
at com.google.api.ads.adwords.axis.AdWordsAxisHeaderHandler.setHeaders(AdWordsAxisHeaderHandler.java:111)
at com.google.api.ads.adwords.axis.AdWordsAxisHeaderHandler.setHeaders(AdWordsAxisHeaderHandler.java:41)
at com.google.api.ads.common.lib.client.AdsServiceClient.setHeaders(AdsServiceClient.java:108)
at com.google.api.ads.common.lib.soap.SoapServiceClient.invoke(SoapServiceClient.java:91)
at com.sun.proxy.$Proxy16.get(Unknown Source)
        at our app's stack calling campaignService.get(campaignSelector)

Caused by: com.google.inject.ProvisionException: Unable to provision, see the following errors:

1) Error injecting constructor, java.lang.NoSuchMethodError: com.google.common.collect.Sets.newConcurrentHashSet()Ljava/util/Set;
  at com.google.api.ads.common.lib.utils.AdsUtilityRegistry.<init>(AdsUtilityRegistry.java:31)
  at com.google.api.ads.common.lib.utils.AdsUtilityRegistry.class(AdsUtilityRegistry.java:31)
  while locating com.google.api.ads.common.lib.utils.AdsUtilityRegistry
    for parameter 6 at com.google.api.ads.adwords.lib.utils.AdWordsInternals.<init>(AdWordsInternals.java:46)
  while locating com.google.api.ads.adwords.lib.utils.AdWordsInternals

1 error
at com.google.inject.internal.InjectorImpl$2.get(InjectorImpl.java:1025)
at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1051)
at com.google.api.ads.adwords.lib.utils.AdWordsInternals.<clinit>(AdWordsInternals.java:36)
... 36 more
Caused by: java.lang.NoSuchMethodError: com.google.common.collect.Sets.newConcurrentHashSet()Ljava/util/Set;
at com.google.api.ads.common.lib.utils.AdsUtilityRegistry.<init>(AdsUtilityRegistry.java:33)
at com.google.api.ads.common.lib.utils.AdsUtilityRegistry$$FastClassByGuice$$20ddab28.newInstance(<generated>)
at com.google.inject.internal.cglib.reflect.$FastConstructor.newInstance(FastConstructor.java:40)
at com.google.inject.internal.DefaultConstructionProxyFactory$1.newInstance(DefaultConstructionProxyFactory.java:61)
at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:105)
at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:85)
at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:267)
at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1103)
at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
at com.google.inject.internal.SingletonScope$1.get(SingletonScope.java:145)
at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:41)
at com.google.inject.internal.SingleParameterInjector.inject(SingleParameterInjector.java:38)
at com.google.inject.internal.SingleParameterInjector.getAll(SingleParameterInjector.java:62)
at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:104)
at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:85)
at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:267)
at com.google.inject.internal.InjectorImpl$2$1.call(InjectorImpl.java:1016)
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1092)
at com.google.inject.internal.InjectorImpl$2.get(InjectorImpl.java:1012)
... 38 more

Message has been deleted

Han Vo

unread,
May 31, 2016, 5:52:16 PM5/31/16
to AdWords API Forum
Here is the selector and the call that caused the application to break

Selector campaignSelector = new Selector();
campaignSelector.setFields(new String[]{"Id", "Name"});

// Get the CampaignService.
CampaignServiceInterface campaignService = user.getService(CampaignServiceInterface.class);
CampaignPage campaigns = campaignService.get(campaignSelector);

Shwetha Vastrad (AdWords API Team)

unread,
Jun 1, 2016, 10:20:31 AM6/1/16
to AdWords API Forum
Hi,

The way to get the AdWords API services using the Java client library is to first construct an AdWordsSession using the OAuth2 credentials and then instantiate the desired service class using the AdWordsServices utility as demonstrated in this basic usage example

Could you tell me what class the object "user" an instance of? Could you also provide the complete stack trace in a private message? Please use Reply privately to author when responding.

Thanks,
Shwetha, AdWords API Team.

Han Vo

unread,
Jun 1, 2016, 10:56:54 AM6/1/16
to AdWords API Forum
I was using the old google-api-client version 1.19.1 upgrading to 1.22.0 worked
Thank you so much
Reply all
Reply to author
Forward
0 new messages