2

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()
Johannes Kuhn
  • 14,778
  • 4
  • 49
  • 73
Akan
  • 270
  • 7
  • 21
  • See: [What is an illegal reflective access?](https://stackoverflow.com/questions/50251798/what-is-an-illegal-reflective-access) – Jesper Mar 14 '22 at 11:31
  • Thanks @Jesper . By using --add-opens I am able to avoid the com.fasterxml.jackson.databind.util.ClassUtil warning. But I am still getting warnings from amazon sdk as I have mentioned in the edit. – Akan Mar 18 '22 at 11:05
  • Does this answer your question? [What is an illegal reflective access?](https://stackoverflow.com/questions/50251798/what-is-an-illegal-reflective-access) – Johannes Kuhn Jul 15 '22 at 13:22
  • Yes, this helped me to ignore these errors. But not fixed it yet. – Akan Jul 22 '22 at 05:19

0 Answers0