Already initialized constant in jruby-openssl
Asked Answered
I

2

13

When running my rails application on torquebox, I get a lot of

already initialized constant: ...

warnings that originate from gems/jruby-openssl-0.8.2/lib/shared/jruby-openssl.rb:16. Is this a security problem? Is there any way to get rid of these warnings?

Ichnite answered 24/1, 2013 at 10:1 Comment(2)
having same warnings tooDecato
I'm trying to figure this out and can't even find the code to see what's on the offending line. My guess is this is packaged with JRuby itself and needs to be issued to teh JRuby group on CodeHaus.org? Still looking...Animadversion
I
14

I could finally get rid of it by removing the gem altogether. According to this source, jruby-openssl is now directly pulled into the jruby project and is not needed anymore as gem.

Thanks everyone for looking into this with me.

Ichnite answered 8/2, 2013 at 13:50 Comment(0)
A
7

I am no longer getting these errors after adding the following to my line in Gemfile.

gem 'jruby-openssl', :require => false

I hope this helps out.

Animadversion answered 28/1, 2013 at 17:6 Comment(7)
From reading around on the comments, seems that this is only necessary to be available. Adding the require => false seemed logical, after I read somewhere that this is really a workaround for the way in which jruby library has packaged openssl (according to some posts on Jruby site.Animadversion
this works for me too. but wanna know whats happening really :)Decato
Can you please add a source where you found this information? I'd like to read a bit further before I apply your fix.Ichnite
The resource I saw, which I can't find anymore, was in a reference to when I was really just trying to find out why there is no code in the jruby-ossl library, and it's because it's been included in jruby core. The way that jruby-core loads openssl (which I believe is where the issue really is), is what makes you need to put this gem in your Gemfile at all (try to find the source for the Gem). So putting require => false makes code available if needed.Animadversion
Perhaps removing the gem completely will expose the error. I haven't tried this step, but if you do that and have the error, and search on it, you may find it. I consider this a JRUBY workaround, as their integration with obenssl is somewhat vague as there is no source in this gem (at least on github currently). Previous versions, sure.Animadversion
still having these warning in production :/Decato
I am seeing the issue as well when using versions of jruby/jruby-jars < 1.7.2 (I haven't tried 1.7.1, or removing the :require => false on 1.7.0) This may have something to do with the warnings.Animadversion

© 2022 - 2024 — McMap. All rights reserved.