1

I'm new to google cloud endpoints. I've got a basic project working on the server side with one endpoint and one method. I can successfully execute the method from the API Explorer.

So now I want to generate a client lib for use in an Android app. When I run

mvn appengine:endpoints_get_client_lib

I get the error output below. The interesting bit is where it says "'JavaApi' object has no attribute '_class_name'". I'm not sure what it's referring to here; I don't have anything called "JavaApi" in my code, so it must be some intermediate generated code.

Any ideas?

[INFO] --- appengine-maven-plugin:1.8.3:endpoints_get_client_lib (default-cli) @ web-service-public ---

[INFO]

[INFO] Google App Engine Java SDK - Generate endpoints get client lib

[INFO] Using Class Name:com.getfitivity.webservice.pub.resource.TrainingProgramResource

[INFO] Executing endpoints Command=[get-client-lib, -cp, C:\Users\Andy\Dev\projects\fitivity\fitivity-service\web-service-public\target\classes;C:\Users\Andy\Dev\projects\fitivity\fitivity-service\web-service-public\target/classes;C:\Users\Andy.m2\repository\com\getfitivity\web-service-common\1.0-SNAPSHOT\web-service-common-1.0-SNAPSHOT.jar;C:\Users\Andy.m2\repository\com\google\appengine\appengine-api-1.0-sdk\1.8.3\appengine-api-1.0-sdk-1.8.3.jar;C:\Users\Andy.m2\repository\com\google\appengine\appengine-endpoints\1.8.3\appengine-endpoints-1.8.3.jar;C:\Users\Andy.m2\repository\javax\inject\javax.inject\1\javax.inject-1.jar, -o, C:\Users\Andy\Dev\projects\fitivity\fitivity-service\web-service-public\target/generated-sources/appengine-endpoints/WEB-INF, -w, C:\Users\Andy\Dev\projects\fitivity\fitivity-service\web-service-public\target/generated-sources/appengine-endpoints, -l, java, com.getfitivity.webservice.pub.resource.TrainingProgramResource] Oct 02, 2013 5:59:47 PM com.google.apphosting.utils.config.AppEngineWebXmlReader readAppEngineWebXml

INFO: Successfully processed C:\Users\Andy\Dev\projects\fitivity\fitivity-service\web-service-public\target/generated-sources/appengine-endpoints\WEB-INF/appengine-web.xml API configuration written to C:\Users\Andy\Dev\projects\fitivity\fitivity-service\web-service-public\target\generated-sources\appengine-endpoints\WEB-INF/public-v1.api API Discovery Document written to ./public-v1-rest.discovery

[ERROR] com.google.appengine.repackaged.com.google.api.client.http.HttpResponseException: 500 Internal Server Error

{"error": {"message": "Internal Server Error", "code": 500, "errors": [{"message": "unknown exception", "debug_info": "'JavaApi' object has no attribute '_class_name'"}]}}

at com.google.appengine.repackaged.com.google.api.client.http.HttpRequest.execute(HttpRequest.java:1050) at com.google.api.server.spi.tools.CloudClientLibGenerator.postRequest(CloudClientLibGenerator.java:53) at com.google.api.server.spi.tools.CloudClientLibGenerator.generateClientLib(CloudClientLibGenerator.java:44) at com.google.api.server.spi.tools.GenClientLibAction.genClientLib(GenClientLibAction.java:67) at com.google.api.server.spi.tools.GetClientLibAction.getClientLib(GetClientLibAction.java:79) at com.google.api.server.spi.tools.GetClientLibAction.execute(GetClientLibAction.java:55) at com.google.api.server.spi.tools.EndpointsTool.execute(EndpointsTool.java:67) at com.google.api.server.spi.tools.EndpointsTool.main(EndpointsTool.java:93) at com.google.appengine.endpoints.EndpointsMojo.executeEndpointsCommand(EndpointsMojo.java:91) at com.google.appengine.endpoints.EndpointsGetClientLib.execute(EndpointsGetClientLib.java:55)

[... uninteresting stack levels omitted...]

2 Answers 2

4

Figured it out. The problem was my API name, as in

@Api(name = "foo")

was a java keyword (in my case "public", because I was defining a public web service API, as opposed to an administrative, internal-use one).

I tried some other java keywords like "private", "static", "for", and "switch" and got the same error.

Sign up to request clarification or add additional context in comments.

Comments

1

Update your pom.xml file to utilize version 1.8.4 of the plugin and try running

mvn clean install appengine:endpoints_get_client_lib to do a full rebuild.

1 Comment

I was on 1.8.4 when I first encountered the problem. I upgraded to 1.8.5, but that didn't help, and then I downgraded to 1.8.3, but that didn't help, either. Same symptom.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.