-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Warning: Problem with Java 9, 10 #161
Comments
Not sure if this is the same issue, but I'm getting this warnings when running rubocop tests under jruby. It does not affect the sucessful outcome of the specs, but since the warnings tell me to report them, I'm doing it!
|
Same thing when installing
|
same here after a fresh install of jruby
|
Same issue with Java 11 |
Bump...need to address this. |
Updated partial traces from running bundler and rails on Java 13:
The following JAVA_OPTS can eliminate all three, but we'll need to get a module set up for the jruby-openssl extension to do this properly:
|
The invasive access from within SecurityHelper might be patched by just using normal SPI mechanism to create the BC certificate factory. That factory is located at Here's an untested patch: diff --git a/src/main/java/org/jruby/ext/openssl/SecurityHelper.java b/src/main/java/org/jruby/ext/openssl/SecurityHelper.java
index 0bc3f8e..236cbba 100644
--- a/src/main/java/org/jruby/ext/openssl/SecurityHelper.java
+++ b/src/main/java/org/jruby/ext/openssl/SecurityHelper.java
@@ -266,10 +267,14 @@ public abstract class SecurityHelper {
throws CertificateException {
final CertificateFactorySpi spi = (CertificateFactorySpi) getImplEngine("CertificateFactory", type);
if ( spi == null ) throw new CertificateException(type + " not found");
- return newInstance(CertificateFactory.class,
- new Class[]{ CertificateFactorySpi.class, Provider.class, String.class },
- new Object[]{ spi, provider, type }
- );
+ return CertificateFactory.getInstance(type, provider);
}
/** |
Perhaps this method was not accessible before, but it is now and this change eliminates one of the module warnings we have been seeing in #161.
Modified my patch above to reflect what actually worked. @kares is testing and releasing now. The other warnings will have to wait until JRuby 9.3 properly handles modules in jars rather than loading them directly into classpath. |
0.10.4 has been released (thanks @kares) with the SecurityHelper warning fixed. |
Did this change actually make it into JRuby? JRuby 9.2.11.1 still gives the warning:
|
I think it might be the issue fixed by the last commit in the master branch of this repo? |
Most likely. I'm not aware of other warnings coming from jruby-openssl (master) at this time, but I think we need a release of the gem to pick up the latest fix. |
This is still happening with JRuby 9.2.12.0 + jruby-openssl 0.10.4 |
This is still happening with JRuby 9.2.13.0 + jruby-openssl 0.10.4 |
As pointed out by @headius three comments ago, this probably just needs a |
There are warnings by using Java9 or Java10
WARNING: Illegal reflective access by org.jruby.ext.openssl.SecurityHelper (file:/home/amos/Amos/Project_Russia/common/smile/rvm/rubies/jruby-9.1.17.0/lib/ruby/stdlib/jopenssl.jar) to constructor java.security.cert.CertificateFactory(java.security.cert.CertificateFactorySpi,java.security.Provider,java.lang.String)
at org.jruby.ext.openssl.SecurityHelper.newInstance(SecurityHelper.java:794)
at org.jruby.ext.openssl.SecurityHelper.getCertificateFactory(SecurityHelper.java:249)
at org.jruby.ext.openssl.SecurityHelper.(SecurityHelper.java:152)
at org.jruby.ext.openssl.OpenSSL.createOpenSSL(OpenSSL.java:57)
at org.jruby.ext.openssl.OpenSSL.load(OpenSSL.java:49)
at org.jruby.javasupport.JavaMethod.invokeDirectWithExceptionHandling(JavaMethod.java:453)
at org.jruby.javasupport.JavaMethod.invokeStaticDirect(JavaMethod.java:365)
at org.jruby.java.invokers.StaticMethodInvoker.call(StaticMethodInvoker.java:47)
at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:318)
at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:155)
at org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:315)
at org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72)
at org.jruby.ir.interpreter.Interpreter.INTERPRET_ROOT(Interpreter.java:107)
at org.jruby.ir.interpreter.Interpreter.execute(Interpreter.java:94)
at org.jruby.ir.interpreter.Interpreter.execute(Interpreter.java:34)
at org.jruby.ir.IRTranslator.execute(IRTranslator.java:42)
at org.jruby.Ruby.runInterpreter(Ruby.java:842)
at org.jruby.Ruby.loadFile(Ruby.java:2903)
at org.jruby.runtime.load.LibrarySearcher$ResourceLibrary.load(LibrarySearcher.java:243)
at org.jruby.runtime.load.LibrarySearcher$FoundLibrary.load(LibrarySearcher.java:34)
at org.jruby.runtime.load.LoadService.tryLoadingLibraryOrScript(LoadService.java:891)
at org.jruby.runtime.load.LoadService.smartLoadInternal(LoadService.java:531)
at org.jruby.runtime.load.LoadService.require(LoadService.java:402)
at org.jruby.RubyKernel.requireCommon(RubyKernel.java:963)
at org.jruby.RubyKernel.require19(RubyKernel.java:956)
at org.jruby.RubyKernel$INVOKER$s$1$0$require19.call(RubyKernel$INVOKER$s$1$0$require19.gen)
at org.jruby.internal.runtime.methods.JavaMethod$JavaMethodOneOrNBlock.call(JavaMethod.java:398)
at org.jruby.internal.runtime.methods.AliasMethod.call(AliasMethod.java:61)
at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:318)
at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:155)
at org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:315)
at org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72)
The text was updated successfully, but these errors were encountered: