Google Cloud Endpoints - APIs Not Updating

I play with Google Cloud Endpoints (Java) and I am having problems updating the APIs after deploying to App Engine (using both Eclipse + Google Plugin and Android Studio).

I created an endpoint based on the Process class (annotated JPA). It sits in my package (say: com.example). The first time I deployed it, I accidentally imported the wrong class (java.lang.Process instead of my com.example.Process). Therefore, I got this error when testing one of the methods in the API:

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? 

Then I fixed the import, re-created the client libraries, and redeployed the application in 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 variable types and method type names and redeployed. But the App Engine does not seem to notice these changes.

I read about how the API browser "caches violently", so I tried to clear the cache, open it in another browser, and even on another PC. Still nothing.

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

I checked the logs for my deployments. They all look fine:

 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 

Does anyone have an idea? Thanks in advance.

+4
source share
1 answer

It doesn't look like your .api files are being restored correctly. If you delete .api files, are they restored when you load either in dev or in App Engine?

Common reasons why .api files are recreated with updated information (i.e. errors I made in the past):

  • Primitives and transfers are not allowed. You must pass the Bean.
  • API methods are not annotated
  • API methods: "private" instead of "public"
+1
source

Source: https://habr.com/ru/post/1490079/


All Articles