Skip to content
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

jopenssl/load - Unable to deploy on jBoss 7.1.1.Final using jRuby 1.7.10 #1413

Closed
lightswitch05 opened this issue Jan 17, 2014 · 12 comments
Closed
Labels
Milestone

Comments

@lightswitch05
Copy link

Error:

org.jruby.rack.RackInitializationException: load error: jopenssl/load -- java.lang.NoClassDefFoundError: org/bouncycastle/asn1/DERBoolean
from org/jruby/RubyKernel.java:1083:in `require'
from classpath:/META-INF/jruby.home/lib/ruby/shared/openssl.rb:1:in `(root)'
...

See entire log file

  • Versions
    • jruby 1.7.10 (1.9.3p392) 2014-01-09 c4ecd6b on Java HotSpot(TM) 64-Bit Server VM 1.7.0_45-b18 [linux-amd64]
    • Java
      • java version "1.7.0_45"
      • Java(TM) SE Runtime Environment (build 1.7.0_45-b18)
      • Java HotSpot(TM) 64-Bit Server VM (build 24.45-b08, mixed mode)
    • JBoss AS 7.1.1.Final
    • Warbler version 1.4.0
    • Rails 4.1.0.beta1
    • Bundler version 1.5.2
  • Steps to reproduce
    1. rails new testapp -T
    2. cd testapp
    3. warble
    4. copy testapp.war to the deployment dir of JBOSS and wait for it to
      deploy
    5. visit /testapp
@mkristian
Copy link
Member

is there any white space in deploy directory somehow involved (just to make
sure) ?

@lightswitch05
Copy link
Author

@mkristian no. I had noticed the other similar tickets involving white space and double checked my path before opening this ticket. The entire deployment path is /opt/installs/jboss/jboss-as-7.1.1.Final/standalone/testapp.war

@lightswitch05
Copy link
Author

I was able to deploy by adding to openssl & bouncy castle to the Gemfile:

gem 'jruby-openssl'
gem 'bouncy-castle-java'

I was under the impression that this was not required for the newest versions of jRuby and Rails 4.x - but that is what fixed it.

@mkristian
Copy link
Member

well, let's call it a workaround but jruby-1.7.x has both those gems as default gems so the problem is somewhere else. for me this is related to #1119 and it looks like jars from gems can load their vendored jar files but jruby itself can not load those jars - which are jars inside jars. so let's keep it open.

@mkristian mkristian reopened this Jan 17, 2014
@atambo
Copy link
Member

atambo commented Jan 20, 2014

@mkristian, so some change between 1.7.9 and 1.7.10 removed the bouncy-castle-java gem from the default gems. I see the bouncy-castle-java.gemspec in lib/ruby/gems/shared/specifications/default but there is no gem in the ib/ruby/gems/shared/gems directory so now warbler explodes with the following:

https://gist.github.com/atambo/8527800

@atambo
Copy link
Member

atambo commented Jan 20, 2014

@mkristian, @jkutner: It looks like with jruby 1.7.10 warbler will fail to include bouncy-castle-java in the war file because bouncy-castle-java is no longer included as a default gem and is instead just a file in the stdlib directory:

https://github.com/jruby/warbler/blob/3c52f33948bb150b8b166639b200e78791fcbc97/lib/warbler/jar.rb#L133

@mkristian
Copy link
Member

that is kind of desired. there are currently 8 default gems in jruby-1.7.10
as you could see
lib/ruby/gems/shared/specifications/default
but the actual gem is part of jruby itself, i.e. you find it under
lib/ruby/shared/ along some other default gems.

I agree that a war file build with warbler highly depends on the jruby
version you use when building the war. but on the other hand I guess
bundler should add or not add the gem depending on the given set of default
gems.

any ways not including the gem in the war file should be not a problem -
the problem is still that the webapp-classloader/jruby-classloader needs to
be able to load those embedded jars from jruby itself.

what happens if you $ bundle update with jruby-1.7.10 ? why does bundler
anyways take care of bouncy-castle-java - is it part of your Gemfile ?

@atambo
Copy link
Member

atambo commented Jan 20, 2014

Ya we had jruby-openssl in our gemfile and bouncy-castle-java was a dependency of jruby-openssl. We are able to workaround this issue by removing jruby-openssl from the gemfile and then moving the krypt, jopenssl, and bouncycastle jars into the WEB-INF/lib directory of our war file. So I agree all these problems would go away if we could get the embedded jars to load in websphere.

@lightswitch05
Copy link
Author

Update for jRuby 1.7.11 - my previous workaround of adding:

gem 'jruby-openssl'
gem 'bouncy-castle-java'

no longer works. Warbler complains:

warning: skipping bouncy-castle-java (/path/to/jruby-1.7.11/lib/ruby/gems/shared/gems/bouncy-castle-java-1.5.0147 does not exist)

and of course since warbler doesn't find it, jBoss complains:

--- Backtrace
Bundler::GemNotFound: Could not find bouncy-castle-java-1.5.0147 in any of the sources
   materialize at /opt/installs/jboss/jboss-as-7.1.1.Final/standalone/tmp/vfs/temp3c38813284f63234/pricing_management.war-501a0871d7ebdf1c/WEB-INF/gems/gems/bundler-1.5.3/lib/bundler/spec_set.rb:92

@jkutner
Copy link
Member

jkutner commented Feb 26, 2014

I just merge a patch from @mkristian that may fix this:
jruby/warbler#241

@mkristian
Copy link
Member

@lightswitch05
try to add WEB-INF/init.rb to your war file with
require 'bcpkix-jdk15on-1.47.jar'
require 'bcprov-jdk15on-1.47.jar'

and let me know if that helps. I needed to add this for most servlet containers when I worked on https://github.com/mkristian/war-pack. will be not needed for the next jruby 1.7.12.

@kares kares added the openssl label Mar 20, 2015
@kares
Copy link
Member

kares commented Mar 20, 2015

is this still an issue with JRuby >= 1.7.16 (+ jruby-openssl 0.9.6) or can we close this one ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants