I’m using app engine with Spring and I get the following Exception:
java.lang.SecurityException: java.lang.IllegalAccessException:
Reflection is not allowed on private java.lang.Throwable
This happens when serializing the result of a controller using ResponseBody:
@RequestMapping("/mapping")
public @ResponseBody
Response handleRequest(Request request) {
The Response object has a private Throwable with its getters and setters.
Why isn’t gae able to reflect on it?
First, the security exception is a sandbox restriction. A sandboxed class is typically not allowed to use reflection to access private members of another class. (For good reason). Presumably GAE is either itself sandboxed, or is sandboxing your classes.
So why is this happening when you have getters and setters for the private field?
My guess is that the signatures for the getter and/or setter methods do not precisely match the name and type of the private field. Or maybe they are not accessible. Check those. If that doesn’t help, try making the private Throwable field public (ick) as an experiment.