I had exactly the same error. In my case the problem was that I have added custom method getEntity to my class that is wrapped into API. This method was intended to cast my class to Entity objects (as I did not use JDO/JPA). Something like:
public class MyUser {
private String userCookie;
public String getUserCookie() {
return userCookie;
}
public void setUserCookie(String userCookie) {
this.userCookie = userCookie;
}
...
public Entity getEntity(){
Entity e = new Entity("MyUser");
e.setProperty("userCookie", this.getUserCookie());
...
return e;
}
}
(Now I understand that it was not good architecture). And in my API get method I wrote something like:
@Api(name = "user")
public class UserApi {
@ApiMethod(name = "users.insert")
public void insert(MyUser user) {
DatastoreService datastore = DatastoreServiceFactory.getDatastoreService();
e = user.getEntity();
datastore.put(e);
}
}
It was a mistake to start method name with getXYZ prefix when one do not have XYZ property in the class which is expected to be POJO (and that is a case in cloud endpoints). I just renamed getEntity method to convertToEntity and everything started working. So, check if you classes do not have custom getters. Getters and setters should be only for properties declared in the class.