Guice provision errors while trying to access BudgetOrderServiceInterface

663 views
Skip to first unread message

ak4chen

unread,
Jul 20, 2012, 6:33:03 PM7/20/12
to adwor...@googlegroups.com
Hi all,

So in the move to strip my code of references to v13 due to its imminent drop of support, I was intending to try out a new way to access budget information. However, in a unit test case where I tried to make that happen (using the jars from http://code.google.com/p/google-api-ads-java/downloads/list, adwords-axis-examples-1.6.0.tar.gz), I ended up getting a Guice provision error instead, and am fairly uncertain as to how do approach fixing it.

Any ideas would be greatly appreciated.

Failure trace:

com.google.inject.ProvisionException: Guice provision errors:

1) null returned by binding at com.google.api.ads.common.lib.factory.FactoryModule$AdsServiceClientFactoryInterface.create()
 but parameter 2 of com.google.api.ads.adwords.lib.client.AdWordsServiceClient.<init>() is not @Nullable
  while locating com.google.api.ads.adwords.lib.client.AdWordsSession annotated with @com.google.inject.assistedinject.Assisted(value=adsSession)
    for parameter 2 at com.google.api.ads.adwords.lib.client.AdWordsServiceClient.<init>(AdWordsServiceClient.java:56)
  while locating com.google.api.ads.adwords.lib.client.AdWordsServiceClient annotated with interface com.google.inject.assistedinject.Assisted

1 error
at com.google.inject.internal.InjectorImpl$4.get(InjectorImpl.java:987)
at com.google.inject.assistedinject.FactoryProvider2.invoke(FactoryProvider2.java:632)
at $Proxy186.create(Unknown Source)
at com.google.api.ads.common.lib.factory.helper.BaseAdsServiceClientFactoryHelper.createServiceClient(BaseAdsServiceClientFactoryHelper.java:87)
at com.google.api.ads.common.lib.factory.helper.BaseAdsServiceClientFactoryHelper.createAdsServiceClient(BaseAdsServiceClientFactoryHelper.java:72)
at com.google.api.ads.common.lib.factory.AdsServiceClientFactory.getServiceClient(AdsServiceClientFactory.java:73)
at com.google.api.ads.common.lib.factory.BaseAdsServiceClientFactory.getServiceClientAsInterface(BaseAdsServiceClientFactory.java:79)
at com.google.api.ads.adwords.lib.factory.AdWordsServices.get(AdWordsServices.java:84)
at com.cobalt.dap.channel.service.google.v201109_1.AbstractGoogleApiClient.getService(AbstractGoogleApiClient.java:197)
at com.cobalt.dap.channel.service.google.v201109_1.AbstractGoogleApiClient.getOrReuseService(AbstractGoogleApiClient.java:179)
at com.cobalt.dap.channel.service.google.v201109_1.GoogleApiClient.getBudgetOrderService(GoogleApiClient.java:27)
at com.cobalt.dap.channel.service.google.v201109_1.GoogleApiClientTest.getBudget(GoogleApiClientTest.java:54)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at testutil.AutowireRule$AutowireStatement.evaluate(AutowireRule.java:74)
at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)

Kevin Winter

unread,
Jul 24, 2012, 5:40:05 PM7/24/12
to adwor...@googlegroups.com
Hi,
  Can you provide a snippet for how your code is accessing the new java library?  If you included all the jars from that tarball, this shouldn't happen (double-check to make sure you aren't missing/have removed any).

Any other steps you took to set this up would also be helpful.

- Kevin Winter
AdWords API Team

Jim McCabe

unread,
Jul 24, 2012, 5:47:53 PM7/24/12
to adwor...@googlegroups.com
I work with ak4chen and we ultimately took a different approach.

We made a small JAR out of the v13 classes from 8.4.1.  Then we upgraded to 8.7.0, but also use this new tiny v13 JAR.  Finally we made a little shim to implement the AdWordsService and AdWordsVersion objects needed to prop up v13.  Works great!

Jim

Dustin Mowcomber

unread,
Mar 18, 2013, 11:15:20 PM3/18/13
to adwor...@googlegroups.com
I dont understand how you fixed the problem. Can you explain a little more?

Jacky cheng

unread,
Mar 21, 2017, 1:30:00 AM3/21/17
to AdWords API Forum
Hi,

we upgrade to v201702 , also find this error . can you tell me how you fix the problem .   
Failure trace:
Unable to provision, see the following errors:

1) null returned by binding at com.google.api.ads.common.lib.factory.FactoryModule$AdsServiceClientFactoryInterface.create()
 but parameter 2 of com.google.api.ads.adwords.lib.client.AdWordsServiceClient.<init>() is not @Nullable
  while locating com.google.api.ads.adwords.lib.client.AdWordsSession annotated with @com.google.inject.assistedinject.Assisted(value=adsSession)
    for parameter 2 at com.google.api.ads.adwords.lib.client.AdWordsServiceClient.<init>(AdWordsServiceClient.java:55)
  while locating com.google.api.ads.adwords.lib.client.AdWordsServiceClient annotated with @com.google.inject.internal.UniqueAnnotations$Internal(value=1)

1 error

Peter Oliquino

unread,
Mar 21, 2017, 2:18:37 AM3/21/17
to AdWords API Forum
Hi Jacky,

Seeing that this is a rather old, could you create a new forum thread? We can continue our discussion regarding your concern from there.

Best regards,
Peter
AdWords API Team
Reply all
Reply to author
Forward
0 new messages