Menu

#1526 Illegal reflective access warning on JDK11

version 2.4.x
open-fixed
None
5
2019-06-04
2018-10-20
Andrea Aime
No

From the warning emitted by the JDK:

WARNING: Illegal reflective access by org.hsqldb.persist.RAFileNIO (file:/home/aaime/.m2/repository/org/hsqldb/hsqldb/2.4.1/hsqldb-2.4.1.jar) to method java.nio.DirectByteBuffer.cleaner()

Discussion

  • MichaeL

    MichaeL - 2019-01-04

    Hello,

    I can confirm this issue. I use the epsg database and get the following warning (using java 9 and hsqldb 2.4.1):

    ... INFORMATION: dataFileCache commit end WARNING: An illegal reflective access operation has occurred WARNING: Illegal reflective access by org.hsqldb.persist.RAFileNIO (file:/D:/lib/hsqldb.jar) to method java.nio.DirectByteBuffer.cleaner() WARNING: Please consider reporting this to the maintainers of org.hsqldb.persist.RAFileNIO 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 ...

    regards
    Micha

     
  • Konstantin Kolinko

    I am also observing this warning, using HSQLDB 2.4.1 in a web application deployed on Apache Tomcat running with OpenJDK 11.0.2.

    There is a workaround.
    If I add the following option to Java command line, the warning disappears:

    --add-opens=java.base/java.nio=ALL-UNNAMED
    

    For sake of completeness, I should add that
    startup scripts of Apache Tomcat also add the following options to the command line. I do not know whether they are important for HSQLDB. (Source code)

    --add-opens=java.base/java.lang=ALL-UNNAMED
    --add-opens=java.base/java.io=ALL-UNNAMED
    --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED
    
     
  • Fred Toussi

    Fred Toussi - 2019-04-30
    • assigned_to: Fred Toussi
     
  • Fred Toussi

    Fred Toussi - 2019-04-30

    Fixed and committed for version 2.5.0

     
  • Fred Toussi

    Fred Toussi - 2019-04-30
    • status: open --> open-fixed
     
  • Fred Toussi

    Fred Toussi - 2019-04-30

    Fixed and committed for version 2.5.0

     
  • MichaeL

    MichaeL - 2019-05-01

    Thank you for your effort.

     

Log in to post a comment.