-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@JsonIgnoreProperties
: ignoring the "cause" property of Throwable
on GAE
#877
Comments
I've also tried using mixins, and I still get the same error: public abstract class ThrowableMixin {
@JsonIgnore private Throwable cause;
@JsonIgnore public abstract Throwable getCause();
} objectMapper.addMixIn(MyException.class, ThrowableMixin.class);
MyException myException = objectMapper.readValue("{}", MyException.class); |
I was able to fix this for my case using a custom Still, shouldn't any of Leaving this issue open because this may be a bug with handling ignored properties; but may be closed at any time as far as I am concerned. |
@mmazi Yes, it should; the problem here is because Thank you for reporting the problem; I hope we will be able to fix this in a future version. |
@JsonIgnoreProperties
: ignoring the "cause" property of Throwable
on GAE
I am not able to reproduce the issue: tests show that use of |
I'm having the same problem. The issue is that Google App Engine restricts reflection of java.lang.Throwable (and probably other classes in the JDK). Could exception serialization use Throwable.initCause() and Throwable.setStacktrace() rather than setting private fields? |
@JsonIgnoreProperties
: ignoring the "cause" property of Throwable
on GAE@JsonIgnoreProperties
: ignoring the "cause" property of Throwable
on GAE
@davidkilliansc it is quite difficult to work on this without reproduction. But in theory it might be possible to suppress |
@cowtowncoder For testable reproduction, maybe a security policy for the tests could be configured to restrict reflection access to Throwable. |
@davidkilliansc that's a great idea. I wonder how easy that'd be... I haven't created those, but sounds doable. Would be useful for other tests too I bet. |
Looking at However, it is entirely possible that attempt to call |
Added an ugly fix for 2.7.8, in which specific check is made for Will try to improve the fix for 2.8 (to ideally just defer forced access override), but wanted to keep patch somewhat minimal for 2.7 to reduce chance of regression. |
@cowtowncoder Fantastic, thanks! |
Deserializing an exception class from json on Google App Engine causes this error:
I tried preventing this by using
@JsonIgnoreProperties
:... but the same error still occurs. What am I doing wrong? What else could I do?
I've also considered setting
MapperFeature.CAN_OVERRIDE_ACCESS_MODIFIERS
to false, but I don't like this solution because I need this setting to betrue
in some other cases (in particular, I provide no-arg constructors for Jackson, but they should't be public in my API).The text was updated successfully, but these errors were encountered: