djrshn2346
(Roshan Yadav)
January 12, 2023, 11:40am
1
Getting Illegal reflective access errors along with these warnings:
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.jruby.ext.openssl.SecurityHelper (file:/{...}/jruby{...}jopenssl.jar) to field java.security.MessageDigest.provider
WARNING: Please consider reporting this to the maintainers of org.jruby.ext.openssl.SecurityHelper
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
Tried these solutions but none of them are working:
opened 01:15AM - 31 Jan 20 UTC
closed 09:14PM - 20 Mar 20 UTC
### Environment
- jruby 9.2.9.0 (2.5.7) 2019-10-30 458ad3e OpenJDK 64-Bit Serve… r VM 13.0.2+8 on 13.0.2+8 +jit [darwin-x86_64]
- openjdk version "13.0.2" 2020-01-14 [AdoptOpenJDK (build 13.0.2+8)]
- macOS Mojave 10.14.6
#### Notes
- Installed adoptopenjdk using [homebrew-cask formula](https://github.com/Homebrew/homebrew-cask/blob/959836865f73a4a8e21e6aaee1ffb4db5f27c19f/Casks/adoptopenjdk.rb)
- Installed jruby using [ruby-build formula](https://github.com/rbenv/ruby-build/blob/73b926b77cd971946dfe966cfb2c954e1d24a12e/share/ruby-build/jruby-9.2.9.0)
### Observed behavior
```
$ jruby -e 'puts "hi"'
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.headius.backport9.modules.Modules to method sun.nio.ch.NativeThread.signal(long)
WARNING: Please consider reporting this to the maintainers of com.headius.backport9.modules.Modules
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
hi
```
### Expected behavior
No warnings.
### Investigation/Similar Issues
- headius/backport9#2
- Tried the suggested `--add-opens` flags, no change
- #5864
- Running newer jruby build, still seeing same warnings
opened 09:01PM - 26 Feb 19 UTC
Java 11 Support
int-shortlist
When running Logstash `6.7.0` Build Candidate with OpenJDK Java 11, warnings abo… ut `IllegalReflectiveAccess` are displayed:
```
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.jruby.util.SecurityHelper (file:/Users/robbavey/test/6.7.0bc3/logstash-6.7.0/logstash-core/lib/jars/jruby-complete-9.2.6.0.jar) to field java.lang.reflect.Field.modifiers
WARNING: Please consider reporting this to the maintainers of org.jruby.util.SecurityHelper
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```
```
This appears to be related to a [known issue](https://github.com/jruby/jruby/issues/4834) in JRuby.
[This comment](https://github.com/jruby/jruby/issues/4834#issuecomment-382917227) describes a mitigation to avoid the warnings. Adding the following to `jvm.options` (caveat: only tested with a very simple pipeline) will allow Logstash to start without warning in Java 11, but prevents Logstash from starting up on Java 8:
```
--add-opens=java.base/java.lang=ALL-UNNAMED
--add-opens=java.base/java.security=ALL-UNNAMED
--add-opens=java.base/java.util=ALL-UNNAMED
--add-opens=java.base/java.security.cert=ALL-UNNAMED
--add-opens=java.base/java.util.zip=ALL-UNNAMED
--add-opens=java.base/java.lang.reflect=ALL-UNNAMED
--add-opens=java.base/java.util.regex=ALL-UNNAMED
--add-opens=java.base/java.net=ALL-UNNAMED
--add-opens=java.base/java.io=ALL-UNNAMED
--add-opens=java.base/java.lang=ALL-UNNAMED
--add-opens=java.base/javax.crypto=ALL-UNNAMED
--add-opens=java.management/sun.management=ALL-UNNAMED
```
elastic:master
← karenzone:java-warnings
opened 05:47PM - 19 Sep 19 UTC
Add info for Java 11 `illegal reflective access` errors.
Fixes #10498
Rela… ted: #10496
Can anyone help here?
Thanks in advance.
Badger
January 12, 2023, 6:23pm
2
When you start logstash you should get a "Starting Logstash" message that reports the logstash and jruby version. What does it show?
djrshn2346
(Roshan Yadav)
January 13, 2023, 5:22am
3
JRUBY_VERSION="9.3.8.0"
LOGSTASH="8.4.3"
Badger
January 13, 2023, 6:45pm
4
See here . Some of the underlying access errors in SecurityHelper were fixed in JRuby 9.3, but apparently not all.
djrshn2346
(Roshan Yadav)
January 16, 2023, 5:01am
5
Yes, i have tried these but still not working. It is also pasted in my question.
Badger
January 16, 2023, 5:30pm
6
OK, so as the message says, report it to the maintainers of org.jruby.ext.openssl.SecurityHelper. They are the folks who can fix it.
djrshn2346
(Roshan Yadav)
January 23, 2023, 9:58am
7
Hi @Badger ,
Can you help me how to report them?
system
(system)
Closed
February 20, 2023, 9:59am
8
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.