-
-
Notifications
You must be signed in to change notification settings - Fork 925
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
Error running rspec (LoadError: load error: jopenssl/load -- java.lang.NoClassDefFoundError: org/bouncycastle/asn1/DERBoolean) #2079
Comments
that is not enough info to reproduce the problem. the interesting output $ jruby -J-Djruby.debug.loadService=true which would show how jruby tries to load those bouncy-castle jars whether you are saying it fails on travis but from this I conclude it works on your is this by any chance a public/open project ? |
Sadly no it's proprietary code, so can't show you the rest of the project, although I could reproduce little sanitised bits of it if you need any specific parts. The project fails on both my own dev box and Travis in the same way. I have a ~700 line trace from running jruby -J-Djruby.debug.loadService=true if you want it, there is no mention of bouncy castle or openssl in it though. FWIW the command behaves a bit weirdly, I have to press a key before it starts logging, and it sort of hangs after logging the big trace. |
I take the 700 line trace as a next step - maybe it gives some clues what |
Here's the trace: https://gist.github.com/themasterchef/abc3dd3b4696210a2b8f |
all I see here is that it ends after loading or while loading the first any minimal Gemfile + Jarfile which produces the error would be helpful, |
Gemfile with most (but not all) of our app's gems stripped out:
Edit: apparently the contents of the Gemfile have almost nothing to do with it! When I used a blank Jarfile the DERBoolean error went away. Suspect something is up in Jbundler and the way that required Java things interact with required (j)ruby things. Jarfile that caused DERBoolean error (it seems adding even one jar causes the error):
|
Managed to narrow down the error even more. It turns out that using This is the Rakefile as it stands:
|
thanx for the input BUT I was not able to reproduce it and I was NOT able to bundle exec rake spec work in a new scaffolded rails application :( BUT I remembered I did see something similar before #1549 but can not reproduce this either. |
In a new scaffolded Rails app Test::Unit is (or at least was last I used the generator) the default test framework, so 'rake spec' would have no meaning, only 'rake test' would work. But if you installed Rspec-rails and could not do a 'rake spec' then yeah that is concerning |
well, |
ok - a clean start again and I got the problem reproduced. it is jbundler and rspec somehow forking/spawning the rspec command. as workaround add
to your spec/spec_helper.rb will fix on jar-dependencies (used by jbundler to require jars) |
this finally fixes #52 Sponsored by Lookout Inc.
@themasterchef should be fixed with jbundler-0.7.0 |
Cool - the spec_helper workaround you posted above is working nicely in the meantime. |
In my Jruby / Rails project, when I attempt to run my Rspec test suite (on Travis) I get the following error:
Note that all previous steps including
bundle install
,bundle exec rake db:migrate
etc work fine. The grief just happens when we hit Rspec for some reason, probably because this is the first point that a significant portion of the Rails app is being loaded up.This happens on the standard Travis Ubuntu build slave VM, building a Ruby project with jruby-19mode (which was jruby-1.7.16 at the last count), on both OpenJDK AND Oracle JDK.
This is the output of 'bundle install' so you can see which gems are being installed. Being Travis, we can be sure that the VM was built from scratch, and that no other old versions of gems or rubies are hanging around by mistake.
FWIW, jbundler is in there because we use a couple of Maven JARs too. It may or may not be messing up the class loading of bouncy castle, but we certainly don't list any bouncy castle or openssl related JARs in the Jarfile.
The text was updated successfully, but these errors were encountered: