Load error: openssl -- java.lang.NoClassDefFoundError: Could not initialize class org.jruby.ext.open

Hello G.s,

I am trying to embed JRuby in a Java project. I am using
“jruby-complete-1.7.4.jar” and ScriptingContainer. For some reason,
the following script throws error.

ScriptingContainer container = new ScriptingContainer();
container.runScriptlet(“require ‘net/https’”);

This fails with the exception - load error: openssl –
java.lang.NoClassDefFoundError: Could not initialize class
org.jruby.ext.openssl.ASN1.

This happens only in few computers. We don’t have jruby-openssl and
bouncy castle gem installed. My class path contains only
“jruby-complete-1.7.4.jar”. I am wondering why this error happens and
what should be done to work around this problem? How can this work on
a computer and fails on a different one? Any help to debug the issue
would be great.

Jruby version - 1.7.4
System - Mac OS X 10.8.4


Thanks
Navaneeth

On Mon, 30 Sep 2013, Navaneeth.K.N wrote:

java.lang.NoClassDefFoundError: Could not initialize class
org.jruby.ext.openssl.ASN1.

Perhaps you need the Java Cryptography Extensions as well (JCE)? They’re
distributed separately from the JRE itself.

  • R. Tyler C.

On Mon, Sep 30, 2013 at 9:31 PM, R. Tyler C. [email protected]
wrote:

container.runScriptlet(“require ‘net/https’”);

This fails with the exception - load error: openssl –
java.lang.NoClassDefFoundError: Could not initialize class
org.jruby.ext.openssl.ASN1.

Perhaps you need the Java Cryptography Extensions as well (JCE)? They’re
distributed separately from the JRE itself.

Thanks for the help. I am not sure about this because I see ASN1 in
the Jruby source tree under ext directory. But looks like that is not
part of the jruby-complete.jar.

  • R. Tyler C.

Code: https://github.com/rtyler

Chatter: https://twitter.com/agentdero
[email protected]


Thanks
Navaneeth