question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

I’m trying to create Credential with custom Configuration.

       Credential oAuth2Credential =
                new OfflineCredentials.Builder()
                        .forApi(OfflineCredentials.Api.ADWORDS)
                        .from(configuration)
                        .build()
                        .generateCredential();
  1. Cause: com.google.api.ads.common.lib.exception.ValidationException: Client ID must be set.
        configuration.addProperty("refreshToken", getRefreshToken());
        configuration.addProperty("clientId", getClientId());
        configuration.addProperty("clientSecret", getClientSecret());
        configuration.addProperty("clientCustomerId", getClientCustomerId());
        configuration.addProperty("developerToken", getDeveloperToken());
        configuration.addProperty("isPartialFailure", getIsPartialFailure());
  1. Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is com.google.api.ads.common.lib.conf.ConfigurationLoadException: Encountered a problem reading the provided configuration file “ads.properties”!] with root cause

org.apache.commons.configuration.ConfigurationException: Cannot locate configuration source ads.properties

        configuration.addProperty("api.adwords.refreshToken", getRefreshToken());
        configuration.addProperty("api.adwords.clientId", getClientId());
        configuration.addProperty("api.adwords.clientSecret", getClientSecret());
        configuration.addProperty("api.adwords.clientCustomerId", getClientCustomerId());
        configuration.addProperty("api.adwords.developerToken", getDeveloperToken());
        configuration.addProperty("api.adwords.isPartialFailure", getIsPartialFailure());

Thanks

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
jradcliffcommented, Apr 26, 2018

Hi,

Sorry, that may be a bit confusing. The example specifically calls the getCustomers method of CustomerService since the idea is that it will show you which customers (clientCustomerIds) your OAuth credentials can access. That is actually the only call that lets you skip the clientCustomerId.

For any other service, you will have to also set the clientCustomerId. I’ll make a note to add a comment to the example to clarify that point.

Cheers, Josh, AdWords API Team

1reaction
jradcliffcommented, Apr 26, 2018

Hi,

You’re welcome! 😃

If that approach worked for you, could you close out the issue? If you’re still having trouble, please let me know and I’ll be happy to help.

Cheers, Josh, AdWords API Team

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using custom config settings in extensions — CKAN 2.9.7 ...
Extensions can define their own custom config settings that users can add to their CKAN config files to configure the behavior of the...
Read more >
custom-config - Intel
custom -config. Specify the absolute path or name for a custom TOML configuration file with additional modeling parameters. GUI Equivalent.
Read more >
cordova-custom-config - npm
Cordova/Phonegap plugin to update platform configuration files based on preferences and config-file data defined in config.xml.
Read more >
dpa99c/cordova-custom-config - GitHub
Cordova/Phonegap plugin to update platform configuration files based on preferences and config-file data defined in config.xml - GitHub ...
Read more >
AWS Config Custom Rules
AWS Config Custom Rules are rules that you create from scratch. There are two ways to create AWS Config custom rules: with Lambda...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found