4
votes

I've been playing around with Google Cloud Endpoints (Java) and I'm having trouble getting the APIs to update after I deploy to App Engine (using both Eclipse + Google Plugin and Android Studio).

I created an Endpoint based on a class called Process (annotated with JPA). It sits in my package (let's say: com.example). The first time I deployed it I had accidentally imported the wrong class (java.lang.Process instead of my com.example.Process). So I got this error when I tested one of the methods in the API explorer:

com.google.api.server.spi.SystemService invokeServiceMethod: cause={0}
javax.persistence.PersistenceException: No meta data for java.lang.Process.  Perhaps you need to run the enhancer on this class?

I have then corrected the import, re-generated the client libraries and re-deployed the app to App Engine, but I keep getting the same error. As if App Engine still thinks I'm using java.lang.Process instead of my Process class.

I also made other changes. Like class member variable types and method names and re-deployed. But App Engine doesn't seem to notice these changes.

I read about how the API explorer "violently caches" so I tried clearing the cache, opened in another browser and even on another PC. Still nothing.

Also, I opened the discovery files for my api located in https://.appspot.com/_ah/api/discovery/v1/apis//v1/rest I noticed that the variables types I had changed are still listed as the old types.

I checked the logs for my deploys. They all look ok:

2013-07-06 18:59:59.960 /_ah/spi/BackendService.getApiConfigs 200 291ms 14kb
I 2013-07-06 18:59:59.706 com.google.api.server.spi.BackendService getApiConfigs: apiConfigDir=/base/data/home/apps/s~<my-app>/1.368601601499931812/WEB-INF
I 2013-07-06 18:59:59.707 com.google.api.server.spi.BackendService getApiConfigs: apiConfigFile=/base/data/home/apps/s~<my-app>/1.368601601499931812/WEB-INF/<my-api-name>-v1.api
I 2013-07-06 18:59:59.713 com.google.api.server.spi.BackendService getApiConfigs: apiConfigFile=/base/data/home/apps/s~<my-app>/1.368601601499931812/WEB-INF/messageEndpoint-v1
I 2013-07-06 18:59:59.740 com.google.api.server.spi.BackendService getApiConfigs: apiConfigFile=/base/data/home/apps/s~<my-app>/1.368601601499931812/WEB-INF/deviceinfoendpoint

and in Admin Logs:

2013-07-06 18:59:35 <me>    Successfully updated API configuration  version=1
2013-07-06 18:59:35 <me>    Completed update of a new default version   version=1.2013-07-06T21:59:30Z
2013-07-06 18:59:32 <me>    Deployed a new version  version=1.2013-07-06T21:59:30Z

Anyone has any idea? Thanks in advance.

1
Please check in the project properties that you version is 1. Because if it is not the same as the default version specified in the cloud the update will not make any difference.Evgeny Erlihman
@danilo Have you fixed this?Giuseppe

1 Answers

1
votes

It doesn't seem like your .api files are regenerating properly. If you delete the .api files, do they regenerate upon loading either in dev or to the App Engine?

Common reasons why .api files are re-created with updated information (i.e., mistakes I made in the past):

  • Primitives and enums are not allowed. You must pass back a Bean.
  • API methods are not annotated
  • API methods are "private" instead of "public"