LoginSignup
0
0

More than 3 years have passed since last update.

postgresql jdbcドライバ 9.4.1212 をjdk11で使用すると 'WARNING: An illegal reflective access operation has occurred'が出力される

Last updated at Posted at 2020-04-25

postgresql jdbcドライバ 9.4.1212 をjdk11で使用すると

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.postgresql.jdbc.TimestampUtils (file:/XXX) to field java.util.TimeZone.defaultTimeZone
WARNING: Please consider reporting this to the maintainers of org.postgresql.jdbc.TimestampUtils
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations

と出力されます。

これは、jdk9以上で、保護されたクラスに対して、
Field.setAccessible(true) を実行すると出力されるようです。

jdbc ドライバ 42.2.12 を使用するとこの警告は出力されません。

そこで、42.2.12 の  org.postgresql.jdbc.TimestampUtils のソースを調べてみると、
106行目に
if (JavaVersion.getRuntimeVersion().compareTo(JavaVersion.v1_8) <= 0)
とあり、後続の、Field.setAccessible(true) を回避しています。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0