Cannot read credentials from ads.properties on GAE devserver

102 views
Skip to first unread message

Anders H

unread,
Jan 8, 2014, 12:06:27 PM1/8/14
to adwor...@googlegroups.com
Hi,

I have an application running on App Engine that works as expected on appspot, but when running on the devserver the credentials are not fetched from the ads.properties file.

Is this a known problem with AdWords on App Engine?

This is the info I get on the devserver:

[INFO] Client ID must be set as api.adwords.clientId in ads.properties.
[INFO] If you do not have a client ID or secret, please create one in the API console: https://code.google.com/apis/cons
ole#access caused by: [clientId]
[INFO]  at com.google.api.ads.common.lib.auth.OfflineCredentials$ForApiBuilder.validate(OfflineCredentials.java:337)
[INFO]  at com.google.api.ads.common.lib.auth.OfflineCredentials$ForApiBuilder.build(OfflineCredentials.java:383)
[INFO]  at jaxwsdemo.GetAccountHierarchy.main(GetAccountHierarchy.java:58)
[INFO]  at adwapi.RunExample.doGet(RunExample.java:37)
[INFO]  at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
[INFO]  at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
[INFO]  at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
[INFO]  at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166)
[INFO]  at com.google.appengine.api.socket.dev.DevSocketFilter.doFilter(DevSocketFilter.java:74)
[INFO]  at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
[INFO]  at com.google.appengine.tools.development.ResponseRewriterFilter.doFilter(ResponseRewriterFilter.java:123)
[INFO]  at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
[INFO]  at com.google.appengine.tools.development.HeaderVerificationFilter.doFilter(HeaderVerificationFilter.java:34)
[INFO]  at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
[INFO]  at com.google.appengine.api.blobstore.dev.ServeBlobFilter.doFilter(ServeBlobFilter.java:63)
[INFO]  at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
[INFO]  at com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:43)
[INFO]  at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
[INFO]  at com.google.appengine.tools.development.StaticFileFilter.doFilter(StaticFileFilter.java:125)
[INFO]  at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
[INFO]  at com.google.appengine.tools.development.DevAppServerModulesFilter.doDirectRequest(DevAppServerModulesFilter.ja
va:368)
[INFO]  at com.google.appengine.tools.development.DevAppServerModulesFilter.doDirectModuleRequest(DevAppServerModulesFil
ter.java:351)
[INFO]  at com.google.appengine.tools.development.DevAppServerModulesFilter.doFilter(DevAppServerModulesFilter.java:116)

[INFO]  at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
[INFO]  at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
[INFO]  at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
[INFO]  at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
[INFO]  at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
[INFO]  at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)
[INFO]  at com.google.appengine.tools.development.DevAppEngineWebAppContext.handle(DevAppEngineWebAppContext.java:97)
[INFO]  at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
[INFO]  at com.google.appengine.tools.development.JettyContainerService$ApiProxyHandler.handle(JettyContainerService.jav
a:485)
[INFO]  at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
[INFO]  at org.mortbay.jetty.Server.handle(Server.java:326)
[INFO]  at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
[INFO]  at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:923)
[INFO]  at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:547)
[INFO]  at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
[INFO]  at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
[INFO]  at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
[INFO]  at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)

Best,
Anders

Ray Tsang (AdWords API Team)

unread,
Jan 13, 2014, 3:42:18 PM1/13/14
to adwor...@googlegroups.com
Anders,

Could I trouble you to confirm how you have packaged the ads.properties file for deployment?  (e.g., is it in the .war file, and under certain directly?)
Secondly, what is the commandline that you are using to start the development server?

Thanks,

--
Ray Tsang (AdWords API Advisor)

Anders Hansen

unread,
Jan 14, 2014, 3:40:02 AM1/14/14
to adwordsapi...@google.com, adwor...@googlegroups.com
Hi Ray,

I am using Eclipse for development and have placed the ads.properties file in "src/main/resources", which is in the Java Build Path. I use Maven for compilation from the cmd prompt and the applicatioin is packed as a .war file.

To start the development server I use "mvn appengine:devserver" from the cmd prompt (Windows 7).

I have also tried to place the ads.properties file in my home directory, but with the same result.

Best,
Anders


2014/1/13 Ray Tsang (AdWords API Team) <adwordsapi...@google.com>
--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
http://googleadsdeveloper.blogspot.com
http://groups.google.com/group/adwords-api
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
 
You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to adwor...@googlegroups.com
To unsubscribe from this group, send email to
adwords-api...@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 a topic in the Google Groups "AdWords API Forum" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/adwords-api/PAg4NiPw7Rw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to adwords-api...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ray Tsang (AdWords API Team)

unread,
Jan 15, 2014, 6:20:31 PM1/15/14
to adwor...@googlegroups.com, adwordsapi...@google.com
Anders,

Could I trouble you to place the ads.properties in WEB-INF/ instead?  e.g., src/main/webapp/WEB-INF/ads.properties.

When using the API, instead of .fromFile()... try .fromFile("WEB-INF/ads.properties")...

Thanks!

--
Ray Tsang (AdWords API Advisor)

Anders Hansen

unread,
Jan 16, 2014, 3:46:51 AM1/16/14
to Ray Tsang, adwor...@googlegroups.com
Hi Ray,

I tried your suggestion, and now it works on both the devserver and on appspot.

Thanks a lot.

Best,
Anders


2014/1/16 Ray Tsang (AdWords API Team) <adwordsapi...@google.com>

Ray Tsang (AdWords API Team)

unread,
Jan 16, 2014, 3:15:04 PM1/16/14
to adwor...@googlegroups.com, Ray Tsang
Anders,

You are welcome - glad it was helpful.

Cheers,

--
Ray Tsang (AdWords API Advisor)

Reply all
Reply to author
Forward
0 new messages