question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

JDK 12+ illegal reflective access operation for `Throwable`, `setCause()`

See original GitHub issue

(from mailing list)

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.fasterxml.jackson.databind.util.ClassUtil (...) to method java.lang.Throwable.setCause(java.lang.Throwable)
WARNING: Please consider reporting this to the maintainers of com.fasterxml.jackson.databind.util.ClassUtil
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release

This is probably due to deserializer constructed in BeanDeserializerFactory.buildThrowableDeserializer()ThrowableDeserializer will handle “cause” property by generating a property. It should use initCause(), but perhaps there is non-public setCause() accidentally found…

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:13 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
edudarcommented, Jun 8, 2021

In my case, this happens with amazon was sdk v1 and databind 2.12.3. Results in runtime exception on Java 16 though, not just warning printout. They try to create an exception from the JSON response like {"__type":"ExpiredTokenException","message":"The security token included in the request is expired"} that causes

java.lang.reflect.InaccessibleObjectException: Unable to make final void java.lang.Throwable.setCause(java.lang.Throwable) accessible: module java.base does not "opens java.lang" to unnamed module @43738a82
0reactions
cowtowncodercommented, Jun 9, 2021

@edudar As usual it’d be necessary to get a reproduction of this: description along is unfortunately not enough. If you can create one, it’d be good to file a separate issue: these typically need to be handled on case-by-case basis as the fundamentally it is not possible to have an overall solution.

Read more comments on GitHub >

github_iconTop Results From Across the Web

An illegal reflective access operation has occurred
I'm using jdk-11 on Linux. When starting the Coherence console tool I get this: WARNING: An illegal reflective access operation has occurred.
Read more >
Re: [jackson-user] Illegal reflective access warning in JDK 12
fasterxml.jackson.databind.util.ClassUtil (...) to method > java.lang.Throwable.setCause(java.lang.Throwable) > > WARNING: Please consider ...
Read more >
Warning on Illegal reflective access by com.fasterxml.jackson ...
I am getting the below warning intermittently while running my java application, WARNING: All illegal access operations will be denied in a ...
Read more >
Java 9 Illegal Reflective Access Warning - Baeldung
Before Java 9, the Java Reflection API has a superpower: It could gain access to the non-public class members without limitation.
Read more >
JDK-8214096 sun.security.util.SignatureUtil passes ... - Bug ID
Component: security-libs | Sub-Component: java.security. ... warnings of further illegal reflective access operations WARNING: All illegal access operations ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found