jars from jruby.jar itself do not get copied over to WEB-INF/lib and thi...#241
jars from jruby.jar itself do not get copied over to WEB-INF/lib and thi...#241jkutner merged 1 commit intojruby:masterfrom
Conversation
…things work just fine with the vendored jars inside the gems. fix issue jruby#1453 and others maybe
|
hmm, this kind of surprises me. i'm going to take some time and try to better understand the issue. but i should have this in soon. thanks! |
|
yea, if this works without the |
|
interesting, I wonder if it would still work with those that do not expand the .war archive (rare but still). |
|
the problem before the merge was that warbler copied the jopenssl.jar to WEB-INF/lib and that needs bouncycastle jars. but BC were in jruby-classloader which has the webapp-classloader as parent, i.e. jopenssl.jar could not see the bouncy-castle jars your problem might be related - I do understand to little what 'arjdbc/jdbc/java' does - but with that patch applied the whole warble warfile is much closer to |
|
Thanks for the clarification Christian, that call just triggers a My concern (even as we ignore the issue mentioned) is if this would work with all the JRuby versions supported esp. if you consider not all application servers explode the .war archive - thus JRuby needs to load the jars (missing from WEB-INF/lib) using jar: references ... but maybe I assumed wrong and this does not effect such cases ?! |
|
yes, I also wonder if a packed warfile can load those bouncy-castle jars |
|
exactly - see it will probably work in most cases but probably not when say on Tomcat |
|
With your change in place our warfile lib directory went from: gems-gems-activerecord-jdbc-adapter-1.3.6-lib-arjdbc-jdbc-adapter_java.jar to jruby-core-complete-1.7.10.jar I don't think this was the intention was it? I don't think this was the intention was it? Unless I'm not understanding? Reason for my interest is extremely rare uninitialized constant Krypt::ASN1::BOOLEAN errors upon starting tomcat. So rare that I can go almost half a day of starting and stopping tomcat and only see it once. So I was thinking an issue with warbler in copying out the jar files within the jar files. |
|
@malletto thanks ... would you please maybe setup a minimal rails app where this case be reproduced ... |
|
@malletto I do not get it completely. so before the change you saw never such uninitialized constant Krypt::ASN1::BOOLEAN ans now you see it occasionally ? is that about what you are saying ? |
|
@kares I wanted to had one more thing to our discussion. just look at a normal java servlet project they have to pack jruby-complete.jar (or the modulare maven artifact) into WEB-INF/lib and aspect it to work, there you do not have a 'warbler' which starts to move jar file from gems or move from within jruby-complete.jar. so if things are not working it is a loading problem with jruby itself. |
|
@malletto looking at your jar list: gems-gems-jruby-jars-1.7.10-lib-jruby-core-complete-1.7.10.jar are the same jars as jruby-core-complete-1.7.10.jar Krypt::ASN1::BOOLEAN is part of ruby-stdlib-complete-1.7.10.jar or in gems-gems-jruby-jars-1.7.10-lib-jruby-stdlib-complete-1.7.10.jar so it is really hard to see a difference between the two setups regarding Krypt::ASN1::BOOLEAN would be nice to see the output of jruby when the system property or the obvious question from my claim that there is no difference: did you try the same start+stop tomcat debug cycle with the old setup as well ? |
|
@mkristian very true, but historically Warbler did the moving pretty "smart" ... this likely avoided some of the loading issues JRuby had (and might still have) e.g. the edge case with non-exploded .war(s), also some web-servers might pop up having issues. maybe what would probably the best - to move things forward while keeping an option for this "old but still useful" behaviour. so I would like to propose a Warbler configuration option something like |
|
@kares agreed |
|
maybe ask the user to report an issue if they NEED to use the old behaviour ;) @jkutner what do you think about the extra config ? |
|
@kares for jruby-9000.dev the copy thing will have extra side-effects since the classloader there looks first to loaded jar via require before looking into the parent classloader. i.e. you can have a servlet using bouncy-castle-1.50 and jruby can safely use bouncy-castle-1.47 which is bundled right now. |
|
Yea, I like the extra config. I'll create a ticket and I can do that work myself. |
|
Have a look at #243 and see if that's what you had in mind. |
|
+1 |
|
@mkristian that BC loading does sounds pretty scary ... I'm not sure why and if I wanted that (no "option" to "override" the BC jar). I actually did some BC internals hacking with JRuby - might open a pull, would love to hear your input as well ... maybe it turns out all stupid but I'd like to avoid leakage with multiple runtimes and it seems quite necessary to "avoid" registering the provider. |
|
@kares my BC loading was just example. any servlet container allows to reverse the classloader from parent container to separate your WEB-INF/lib from whatever is load in the parent classloader. next time I use jline.jar as example or xerces from nokogiri ;) reagarding the registering the security provider in jriuby-openssl: I saw the code once and had the feeling that is not the job of jruby to register such a provider - just my thoughts. happy to give another pair of eyes on BC loading code of yours. |
|
Yes will do on monday. I'll report back my findings. On Sat, Mar 1, 2014 at 3:17 AM, Karol Bucek notifications@github.comwrote:
|
|
No sorry for the confusion. We get very rare Krypt::ASN1::BOOLEAN errors On Sat, Mar 1, 2014 at 4:42 AM, Christian Meier notifications@github.comwrote:
|
|
@kares I setup a barebones rails app. My gemfile contains: With the modified warbler my lib directory looks like: With the original unmodified warbler it looks like: Created the war with: Running the 2 war files (since they are executable) with java -jar <war_file> they both start. So maybe this is just a cosmetic thing? Not sure. This doesn't get me any closer to figuring out our extremely random (maybe 4% of the time) Krypt::ASN1::BOOLEAN error problem that has been bothering us for months though, and I have no idea if its related. |
|
@malletto I just downloaded your testapp from jruby/jruby#1119 (comment) and the first thing I could see were some warning: and you have 8 jruby runtimes. so the first thought is that all the problems you see are concurrency issue with krypt gem ! especially since they are rare and thus depending on execution timings. is the strong reason for having 8 runtimes and not only 1 ? |
|
there is krypt-0.0.2.rc1 gem now, could you add that to your Gemfile and see if that works better. that new gem is already part of jruby-1.7.12-SNAPSHOT and on jruby-head |
|
@mkristian Yeah we aren't running in threadsafe mode, yet. So we need to have a pool of runtimes. I'll look at the new rc1 of krypt and see if I can add that to my test app. Not sure why we would have concurrency issues if there are 8 separate runtimes? Aren't they all self contained? |
|
@malletto I have one more thing for you since it is really a startup problem: |
|
@mkristian I'll check that out, thanks. What does it do though? I looked in the documentation: Any negatives to setting to true? |
|
it does start each jruby runtime one after the other. there is no use of |
...ngs work just fine with the vendored jars inside the gems. fix issue jruby/jruby#1435 and others maybe.
currently I just comment out the respective code since there was a reason to include that code. but the problem is that such a copying of jars will divert for example from
$ jruby -S rails server
drastically. I haven't look into how executable jars are packed, i.e. whether they unpack the vendored jars as well.
I think actually the opposite approach would be actually better: to separate the jruby-classloader from its parent classloader, similar what you can configure with servlet-classloader to load its classes first to avoid clashed with the underlying parent-classloader. maven also separates the plugin from each other with the trick.
on the other hand I would not know how to extract the jars from jruby-stdlib-complete or jruby-complete or whatever jruby jars you have configured.
further the current setup duplicates the jars from jruby-jars.gem on fresh rails setup (rails new foobar; cd foobar; warble)
from my personal experience I used a simple maven setup to pack a warfile which always worked on jetty.