Jooq: Illegal reflective access operation on JDK 11

Created on 17 Oct 2018  路  20Comments  路  Source: jOOQ/jOOQ

I only started to receive this warning, when I switched to OpenJDK 11 from Oracle JDK 8.

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.jooq.tools.reflect.Reflect (file:/C:/Users/szabkel/.m2/repository/org/jooq/jooq/3.11.5/jooq-3.11.5.jar) to constructor java.lang.invoke.MethodHandles$Lookup(java.lang.Class)
WARNING: Please consider reporting this to the maintainers of org.jooq.tools.reflect.Reflect
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

Possible connection:
https://github.com/jOOQ/jOOQ/issues/7601
https://github.com/jOOQ/jOOQ/issues/7594
https://github.com/jOOQ/jOOQ/issues/7602

Versions:

  • jOOQ: 3.11.5
  • Java:
openjdk version "11" 2018-09-25
OpenJDK Runtime Environment 18.9 (build 11+28)
OpenJDK 64-Bit Server VM 18.9 (build 11+28, mixed mode)
  • Database (include vendor): postgresql-10.5-2-windows-x64 (EDB installer)
  • OS: Windows 10 x64
  • JDBC Driver (include name if inofficial driver): org.postgresql 42.2.5
Functionality All Editions Medium Fixed Defect

Most helpful comment

Thank you very much for your report.

This has been fixed in jOOQ 3.12 with formal Java 11 support. Specifically, we need to ship separate builds for Java 8 and Java 9+ as fixing this relies on accessing JDK 9 API.

In the meantime, we are integration testing jOOQ 3.11 with Java 11 and our position at this point is that this warning can be ignored for the time being.

All 20 comments

Thank you very much for your report.

This has been fixed in jOOQ 3.12 with formal Java 11 support. Specifically, we need to ship separate builds for Java 8 and Java 9+ as fixing this relies on accessing JDK 9 API.

In the meantime, we are integration testing jOOQ 3.11 with Java 11 and our position at this point is that this warning can be ignored for the time being.

Hi, when is JOOQ 3.12 expected? Previous bug reports said late 2018 or early 2019. I am also having this issue with JDK 11.

Thanks in advance
Sigal

Thanks for your comment @sshahar1. I understand that these log messages are annoying, yet they are purely cosmetic for now, at least on JDK 11.

We have postponed releasing jOOQ 3.12 for a while, as we have been adding new features and a lot of fixes over the past year. It has been a big release, and postponing was well worth it.

We're not reaching feature completeness for 3.12 and will definitely publish it early Q3 2019, with only very minor changes still due.

Hi,
Is there a way to hide this logging message by setting some logger level or ?
Thanks !

@LeaklessGfy This is not a jOOQ feature, it's a JDK thing: https://stackoverflow.com/q/46454995/521799

@lukaseder do I understand correctly that this warning does not appear in the commercial version, but it is still present in the opensource version? I'm still experiencing it with 3.12.0:

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.jooq.tools.reflect.Reflect (file:/home/user/.m2/repository/org/jooq/jooq/3.12.0/jooq-3.12.0.jar) to constructor java.lang.invoke.MethodHandles$Lookup(java.lang.Class)
WARNING: Please consider reporting this to the maintainers of org.jooq.tools.reflect.Reflect
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

Indeed, this is fixed in the Java 11+ distribution of the commercial editions, but for the open source edition, we opted to continue supporting Java 8 in jOOQ 3.12, so this issue persists in the open source edition.

I wonder if we can work around this in another way. Will think about it

@lukaseder I聽think it's not an urgent problem until we start to see usage of the opensource version with one of the future release that will deny such illegal access operation.

It is not urgent, but it has been open and known for a while, and actually, it is fixed :) So I really want to see this being fixed or worked around for all editions.

@lukaseder You could ship a separate JDK11-specific artifact. I for one would love to stop seeing this warning :)

jooq-codegen-maven could be for JDK 8
jooq-codegen-maven-jdk11 could be for JDK 11

Once the main distribution moves to JDK 11, you would drop -jdk11.

Thanks for your suggestions, @cowwoc. We do have various options indeed, and we do explore them already for commercial users (we use different groupIds, not artifactIds). You can find all of our editions and distributions on this page here: https://www.jooq.org/download/versions

Supporting different JDK versions per artifact is a feature we want to offer to paying customers only. It is connected with a significant extra value on the customer side as well as non-negligible cost on our side.

However, as I mentioned previously in this comment https://github.com/jOOQ/jOOQ/issues/7950#issuecomment-526643349, the idea in this issue was that it should have been fixed for the OSS edition. I'm sure there's a possibility to fix it without creating a new distribution just for this (currently) cosmetic issue. A lot of libraries out there can live without such distributions by simply avoiding "bad" API calls in a single distribution.

I'll think about this a bit more and will update this issue. That's probably something we can include in the next patch release, e.g. 3.12.2.

@lukaseder Thanks for following up Lukas. Can we please reopen this issue or open a new one to replace it? I am afraid that this will fall through the crack now that the issue is closed.

Also, I tried suppressing the warning using --add-opens java.base/java.lang=ALL-UNNAMED but it did not help. Any idea what I am doing wrong?

@cowwoc : Here's the new issue: https://github.com/jOOQ/jOOQ/issues/9157

Also, I tried suppressing the warning using --add-opens java.base/java.lang=ALL-UNNAMED but it did not help. Any idea what I am doing wrong?

I don't know - sorry.

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.jooq.tools.reflect.Reflect (file:/home/jaimebrolesi/.m2/repository/org/jooq/jooq/3.12.3/jooq-3.12.3.jar) to constructor java.lang.invoke.MethodHandles$Lookup(java.lang.Class)
WARNING: Please consider reporting this to the maintainers of org.jooq.tools.reflect.Reflect
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

@lukaseder
Its is still present on 3.12.3 with OpenJDK-11.0.6

On my side, it has disappeared at least with 3.13.0.

@brainweb-br @victorbr See https://github.com/jOOQ/jOOQ/issues/9157#issuecomment-587310936.

The fix was implemented in 3.13.0 and backported to 3.12.4

I believe you meant @victornoel 馃槃

I did, indeed :)

馃憢 Hi all, just to notice I always have the same problems... 馃槥

When I execute my unit tests :

[ERROR] OpenJDK 64-Bit Server VM warning: Sharing is only supported for boot loader classes because bootstrap classpath has been appended
[ERROR] WARNING: An illegal reflective access operation has occurred
[ERROR] WARNING: Illegal reflective access by org.jooq.tools.reflect.Reflect (file:/home/antoine/.m2/repository/org/jooq/jooq/3.14.4/jooq-3.14.4.jar) to constructor java.util.UUID(byte[])
[ERROR] WARNING: Please consider reporting this to the maintainers of org.jooq.tools.reflect.Reflect
[ERROR] WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
[ERROR] WARNING: All illegal access operations will be denied in a future release

My setup

  • jooq 3.14.4
  • jdk 11.0.9.1

@antoinedvd I don't think that's the same problem. Can you please open a new issue with some details on how to reproduce this?

Was this page helpful?
0 / 5 - 0 ratings