On Fri, Nov 22, 2019 at 11:57 AM Tatu Saloranta <t...@fasterxml.com> wrote: > > On Fri, Nov 22, 2019 at 9:20 AM Mileta Cekovic <mceko...@gmail.com> wrote: > > > > Hi, seems JDK 9+ Illegal Reflective access by ClassUtil is still present in > > Jackson 2.10.1 > > Namely I got this with JDK 11.0.5, Jackson 2.10.1 then trying to serialize > > LocalDate to JSON using jackson-datatype-jsr310 > > > > WARNING: An illegal reflective access operation has occurred > > WARNING: Illegal reflective access by > > com.fasterxml.jackson.databind.util.ClassUtil > > (file:/C:/Users/mcekovic/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.core/jackson-databind/2.10.1/18eee15ffc662d27538d5b6ee84e4c92c0a9d03e/jackson-databind-2.10.1.jar) > > to field java.time.LocalDate.year > > 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 > > The problem here is that this gives no clue as to where and how access > was triggered. > If code path leading to it was known I could see if this could be > avoided -- I am quite confident that in case of this class, > introspection is not needed since there is explicit serializer -- but > without something like stack trace, it is not possible to really trace > back unfortunately. > > So if anyone has good ideas on how to tease out some more information, > I would be happy to have a look at if and how to avoid triggering this > warning.
Looks like there are some command-line switches: https://stackoverflow.com/questions/49076972/how-can-i-throw-an-exception-for-an-illegal-reflective-access-warning where: "--illegal-access=deny will cause the expected IllegalAccessException or InaccessibleObjectException to be thrown. If you just want the stack traces then --illegal-access=debug is what you are looking for. " would seem helpful in particular... -+ Tatu +- > > -+ Tatu +- -- You received this message because you are subscribed to the Google Groups "jackson-user" group. To unsubscribe from this group and stop receiving emails from it, send an email to jackson-user+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/jackson-user/CAL4a10hZd7tVoZ6%2BvjPnfhMuwWXANrzuoCu6AiyjZoEDuRzSdQ%40mail.gmail.com.