GAE endpoint error: cannot access class member with "private" modifiers

I have a GAE API endpoint that gives me a 503 error. The API endpoint is doing its job properly (processing / sending data to the data store), but as soon as it comes up to return an object, this error occurs:

java.lang.IllegalStateException: Failed to create standard serializer (Oftypecom.google.appengine.repackaged.org.codehaus.jackson.map.ser.std.NullSerializer): Classcom.google.appengine.repackaged.org.codehaus.jackson.map .ser.BasicSeriaiizerFactory cannot access class member com.google.appengine.repackaged.org.codehaus.jackson.map.ser.std.NullSerializer with "private" modifiers

The returned object is an Extended (FacebookUser extends User) object. I thought it might have something to do with accessing private variables of the base class, so I declared all private variables protected; I am still getting this error.

I have another endpoint that returns a FacebookUser object and it works fine. I interpret it as GAE serialization, cannot serialize object on return; the data returned is a lot of the same data that is returned in a single working endpoint. The API endpoint is doing its job as expected, but when it comes to returning an object and data, the above error is thrown.

Any input is greatly appreciated, thanks!

+3


source to share


1 answer


So I figured it out.



I had a function called getToken () in the FacebookUser class. This function was not a getter / setter for a private / protected variable; it was a function that processes the input information into a token. It looks like the GAE Java APIs suggested that getToken was a getter / setter for a private variable called "token". Since there is no private variable called "token", it is throwing the error I saw. I figured it out when it threw an error for the getToken () function, when I ran another function that did not call the getToken () function.

+1


source







All Articles