java - Where should GCM's api.key file be located in the WAR file when deploying application to GAE? -


after "text" itemprop = "text">

I guess that was already running on my machine locally along with Tomcat 6 up on my Google .ar file I am trying to get I created this project in Eclipse and the file structure was slightly different. I think ultimately belongs to the addition of the last part of everything I do not know "api.key" which directory in Google Apps stack trace in your log server following:

  context failed startup com.google.apphosting.utils.jetty.RuntimeAppEngineWebAppContext@1ef3ccd {/, / base / data / on [package-name] file on the web resources .ApiKeyInitializer.getKey (ApiKeyInitializer.java:56 / api. Key) could not be found): home / apps / S ~ [app name] /1.360213803566389174} java.lang.IllegalStateException [package-name] .ApiKeyInitializer.contextI nitialized (ApiKeyInitializer.java:45) (context org.mortbay.jetty.servlet.Context.startContext on org.mortbay.jetty.handler.ContextHandler.startContext (ContextHandler.java:548). Java: 136) org.mortbay. jetty.webapp.WebAppContext.startContext (WebAppContext.java:1250) .WebAppContext.doStart on org.mortbay.jetty.handler.ContextHandler.doStart (ContextHandler.java:517) on org.mortbay.jetty.webapp (WebAppContext.java : 467)   

You can see which directories Google tells which way they should look. When I followed Google's GCM demo (the first link above), he placed the "API file" under the Web-INF / Works Directory. I try to get into the new Google App Engine structure, and I get the error above, I think I'm really close because it is clear that trying to run my servlet, but this file is not Can get it. Does anyone know where it keeps it that he can find it and I can do this work? "post-text" itemprop = "text">

OK, I got it. In my ApiKeyInitializer.java class, I did this:

  private static last string path = "/api.key"; When in fact, it should have been:  
  personal static final string path = "API."   

I followed the build file. I saw that he has said that all the other files, such as in the Meta-INF / directory, / words / web-INF / class / are literally copied. From this, I realized that I should put the name of API in my Eclipse Circle Directory, so that when it was compiled, it was kept properly in war / web-nf / class. In addition to that, the path had to be relative to the src directory, which is why I string path = "Apiaikki" instead of string path = was required to "/ API. Key" .

Comments