jruby 1.7.4, openjdk 1.6.0 "LoadError: load error: openssl" #791

Closed
da3mon opened this Issue Jun 5, 2013 · 10 comments

Projects

None yet

7 participants

@da3mon
da3mon commented Jun 5, 2013

here's a basic dump of system info and the most simple way to reproduce:

$ > uname -srpio
Linux 2.6.18-274.3.1.el5 x86_64 x86_64 GNU/Linux

$ > cat /etc/redhat-release
CentOS release 5.7 (Final)

$ > java -version
java version "1.6.0_20"
OpenJDK Runtime Environment (IcedTea6 1.9.10) (rhel-1.23.1.9.10.el5_7-x86_64)
OpenJDK 64-Bit Server VM (build 19.0-b09, mixed mode)

$ > cat bin/ruby
#!/usr/bin/env bash

cd $(dirname $0)/..

export RUBY=bin/ruby #This is needed to prevent rake from exploding

GEM_HOME=vendor/gems exec java -Xmx2048m  -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode -XX:-ReduceInitialCardMarks -Dfile.encoding=UTF8 -Dclient.encoding.override=UTF8 -jar vendor/jruby.jar --1.9 "$@"
$ > bin/ruby -S irb
irb(main):001:0> RUBY_VERSION
=> "1.9.3"
irb(main):002:0> JRUBY_VERSION
=> "1.7.4"
irb(main):003:0> require 'net/https'
LoadError: load error: openssl -- java.lang.VerifyError: class org.bouncycastle.asn1.ASN1Primitive overrides final method equals.(Ljava/lang/Object;)Z
  from org/jruby/RubyKernel.java:1054:in `require'
  from jar:file:/usr/local/batcave/batcave/releases/20130605023420/vendor/jruby.jar!/META-INF/jruby.home/lib/ruby/shared/rubygems/custom_require.rb:36:in `require'
  from jar:file:/usr/local/batcave/batcave/releases/20130605023420/vendor/jruby.jar!/META-INF/jruby.home/lib/ruby/1.9/net/https.rb:22:in `(root)'
  from org/jruby/RubyKernel.java:1054:in `require'
  from jar:file:/usr/local/batcave/batcave/releases/20130605023420/vendor/jruby.jar!/META-INF/jruby.home/lib/ruby/shared/rubygems/custom_require.rb:1:in `(root)'
  from jar:file:/usr/local/batcave/batcave/releases/20130605023420/vendor/jruby.jar!/META-INF/jruby.home/lib/ruby/shared/rubygems/custom_require.rb:36:in `require'
  from org/jruby/RubyKernel.java:1093:in `eval'
  from (irb):3:in `evaluate'
  from org/jruby/RubyKernel.java:1489:in `loop'
  from org/jruby/RubyKernel.java:1254:in `catch'
  from org/jruby/RubyKernel.java:1254:in `catch'
  from org/jruby/RubyKernel.java:1073:in `load'
  from file:/usr/local/batcave/batcave/releases/20130605023420/vendor/jruby.jar!/META-INF/jruby.home/bin/jirb:13:in `(root)'
  from jirb:1:in `(root)'
irb(main):004:0>
$ > sudo yum remove java-1.6.0-openjdk.x86_64
...
Removed:
  java-1.6.0-openjdk.x86_64 1:1.6.0.0-1.23.1.9.10.el5_7

Complete!

$ > java -version
java version "1.6.0_24"
Java(TM) SE Runtime Environment (build 1.6.0_24-b07)
Java HotSpot(TM) 64-Bit Server VM (build 19.1-b02, mixed mode)

$ > bin/ruby -S irb
irb(main):001:0> RUBY_VERSION
=> "1.9.3"
irb(main):002:0> JRUBY_VERSION
=> "1.7.4"
irb(main):003:0> require 'net/https'
=> true
irb(main):004:0>
@headius
Member
headius commented Jun 6, 2013

Uninstall or update your bouncycastle-java gem. The old one is not binary compatible with the new one, and we moved to the newer one during 1.7 cycle.

@headius headius closed this Jun 6, 2013
@bploetz
bploetz commented Feb 5, 2014

@headius As noted here: rvm/rvm#2597 (comment) it looks like the JDK installed by Mac OSX is including the old/incompatible bouncy castle as an installed extension. Since those classes will have a higher precedent in the classpath, the JVM is preferring those over the new/correct version included with the JRuby install. Is there any way to solve this in the JRuby install itself?

@mkristian mkristian reopened this Feb 5, 2014
@mkristian
Member

actually the master of jruby would work via the commit e4dd5ee

with the 1_7 branch any jar in any gem uses can create similar problems when another version is in same classloader as jruby.

I still think the above it safe enough to be included on the jruby-1_7 branch

@headius
Member
headius commented Feb 26, 2014

@mkristian It may be safe, but it makes me nervous. If it merges an everything passes, I guess it's probably fine. @enebo?

@mkristian
Member

I talked about it with @enebo on irc and he basically shares the feeling
with you. in the end it solves edge cases so keeping it for jruby-9000 is
sufficient IMO.

@enebo
Member
enebo commented Feb 26, 2014

yeah it might be fine but CL is one place where historically we have had unexpected fallout. So this is one area which frightens me too much. If both @headius and I are fearful I think we should not do this. (just wrote this for posterity since @mkristian mentioned out conversation)

@enebo enebo modified the milestone: JRuby 1.7.13, JRuby 1.7.12 Apr 15, 2014
@bliaxiong

I'm getting the following error and now hitting brick wall. Doing an upgrade from Rails 3. I've removed all older versions of Java.

My current setup:

JRuby 1.7.12
OSX 10.8.5
java version "1.8.0_05"
Java(TM) SE Runtime Environment (build 1.8.0_05-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.5-b02, mixed mode)
jruby-openssl 0.9.4
bouncy-castle-java 1.5.0147

load error: jopenssl/load -- java.lang.VerifyError: class org.bouncycastle.asn1.ASN1Primitive overrides final method equals.(Ljava/lang/Object;)Z

load error: jopenssl/load -- java.lang.VerifyError: class org.bouncycastle.asn1.ASN1Primitive overrides final method equals.(Ljava/lang/Object;)Z

load error: jopenssl/load -- java.lang.VerifyError: class org.bouncycastle.asn1.ASN1Primitive overrides final method equals.(Ljava/lang/Object;)Z

Any help or suggestions?

@mkristian
Member

somehow you have an "old" bouncy-castle jar in the classpath or as extension of java as @bploetz described. that will get preference of any bouncy-castle coming from jruby of jruby-openssl

@bliaxiong

Alright, I guess I'll have to dig around and find it. Thanks!

On Tue, May 27, 2014 at 4:56 PM, Christian Meier
notifications@github.comwrote:

somehow you have an "old" bouncy-castle jar in the classpath or as
extension of java as @bploetz https://github.com/bploetz described.
that will get preference of any bouncy-castle coming from jruby of
jruby-openssl


Reply to this email directly or view it on GitHubhttps://github.com/jruby/jruby/issues/791#issuecomment-44340895
.

Thanks!

Blia Xiong
bliaxiong1@gmail.com

@enebo enebo modified the milestone: JRuby 1.7.14, JRuby 1.7.13 Jun 24, 2014
@enebo enebo modified the milestone: JRuby 1.7.14, JRuby 1.7.15 Aug 27, 2014
@bliaxiong

I removed all older instances of Java (1.6). Narrowed it down to using the Apache Tika jar just incase anyone has the same scenario.

@kares kares modified the milestone: Won't Fix, JRuby 1.7.15 Nov 14, 2015
@kares kares closed this Nov 14, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment