googleads / googleads-java-lib

Google Ad Manager SOAP API Client Library for Java
Apache License 2.0
226 stars 360 forks source link

Google API Error #160

Closed kdotzenrod517 closed 5 years ago

kdotzenrod517 commented 6 years ago

We’re receiving an exception in one of our services, and we are wondering if this is an authentication issue or a dependency error. Pasting the error below:

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.dfp.lib.client.DfpServiceClient.() is not @Nullable while locating com.google.api.ads.dfp.lib.client.DfpSession annotated with @com.google.inject.assistedinject.Assisted(value=adsSession) for parameter 2 at com.google.api.ads.dfp.lib.client.DfpServiceClient.(DfpServiceClient.java:56) while locating com.google.api.ads.dfp.lib.client.DfpServiceClient annotated with @com.google.inject.internal.UniqueAnnotations$Internal(value=1) 1 error

Any insight into this error would be greatly appreciated.

nwbirnie commented 6 years ago

Hey, it is likely that you have both the DFP and Ad Manager dependencies coexisting in your project. Please check your project for conflicting versions of the com.google.api-ads modules, these should all be on the same version.

kdotzenrod517 commented 6 years ago

hey! this is the dependency tree of the only instance of com.google.api-ads in the project. It looks like they are all on the same version:

| --- com.google.api-ads:ads-lib-axis:3.16.0 | +--- com.google.api-ads:ads-lib:3.16.0 () | +--- commons-discovery:commons-discovery:0.4 | | --- commons-logging:commons-logging:1.0.4 -> 1.2 | +--- com.google.http-client:google-http-client:1.23.0 () | +--- javax.xml:jaxrpc-api:1.1 | +--- org.apache.axis:axis:1.4 | --- wsdl4j:wsdl4j:1.6.2 -> 1.6.3

nwbirnie commented 6 years ago

The dependency on ads-lib-axis is wrong. If you're using AdWords API you should change this to adwords-axis and similarly, for DFP to dfp-axis.

kdotzenrod517 commented 6 years ago

Something like this?

compile('com.google.api-ads:dfp-axis:3.16.0')

nwbirnie commented 6 years ago

Yes, and looking at the dependency tree you will have to add com.google.api-ads:ads-lib:3.16.0 again, since this was being included transitively.

kdotzenrod517 commented 5 years ago

we are still experiencing this error, our Google dependencies are:

compile('com.google.api-ads:ads-lib:3.16.0') compile('com.google.api-ads:dfp-axis:3.16.0'){ exclude group: "com.google.guava", module:"guava" exclude group: "com.google.guava", module:"guava-jdk5" } compile ("com.google.cloud:google-cloud:0.26.0-alpha") { exclude group: "javax.servlet", module: "servlet-api" exclude group: "com.google.guava", module:"guava" } compile("com.google.code.gson:gson:2.8.2"){ exclude group: "com.google.guava", module:"guava" } compile("com.google.apis:google-api-services-sheets:v4-rev469-1.22.0"){ exclude group: "com.google.guava", module:"guava" exclude group: "com.google.guava", module:"guava-jdk5" }

Would any of these dependencies be conflicting?

kdotzenrod517 commented 5 years ago

Any insight into this would be much appreciated, we are still receiving the error below and believe it has something to do with our dependencies:

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.dfp.lib.client.DfpServiceClient.() is not @Nullable while locating com.google.api.ads.dfp.lib.client.DfpSession annotated with @com.google.inject.assistedinject.Assisted(value=adsSession) for parameter 2 at com.google.api.ads.dfp.lib.client.DfpServiceClient.(DfpServiceClient.java:56) while locating com.google.api.ads.dfp.lib.client.DfpServiceClient annotated with @com.google.inject.internal.UniqueAnnotations$Internal(value=1) 1 error

jradcliff commented 5 years ago

Hi,

A few follow-up questions that will help with our investigation:

  1. Do you encounter this error for every service, or only for a specific use case? If the latter, please let us know the use case that is not working as well as one that is.
  2. Is there more of your stack trace that you could share, or a snippet of your code that's triggering this exception?

Thanks, Josh

kdotzenrod517 commented 5 years ago

We were able to resolve the issue.

Thank you for your help!