1 year ago

#288211

test-img

Akan

Warning on Illegal reflective access by com.fasterxml.jackson.databind.util.ClassUtil

I am getting the below warning intermittently while running my java application,

WARNING: All illegal access operations will be denied in a future release
WARNING: An illegal reflective access operation has occurred
WARNING: Please consider reporting this to the maintainers of 
com.fasterxml.jackson.databind.util.ClassUtil
WARNING: Illegal reflective access by com.fasterxml.jackson.databind.util.ClassUtil 
(file:/usr/app/my_app.jar) to field java.lang.Throwable.cause

I think the below line may have connection with this,

private final static ObjectMapper mapper = new ObjectMapper();
AuthInfo authInfo = mapper.readValue(userInfo, AuthInfo.class);

However I am unable to reproduce this issue in my local even if I try with the same input that production has. I have used --add-opens to ignore these warnings, its working but I want to know why this is happening and how to fix that reflection access warnings.

Tried to use ā€“-illegal-access=debug to get the stack trace but I am getting Used:

java ā€“-illegal-access=debug -jar my_application.jar

Getting error like,

Error: Could not find or load main class ā€“-illegal-access=debug
Caused by: java.lang.ClassNotFoundException: ā€“-illegal-access=debug

I am using Java 11.0.2

Edit: I am also getting the below warning,

WARNING: Illegal reflective access by com.amazonaws.util.XpathUtils (file:/usr/app/m1x-publish.jar) to method com.sun.org.apache.xpath.internal.XPathContext.getDTMManager()

java

reflection

java-11

jackson-databind

fasterxml

0 Answers

Your Answer

Accepted video resources