-
-
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
(some) classloaders do not see the default gems and can not update/downgrade those gems #1761
Comments
just had a trial with removing all the jossl from jruby-stdlib and "install" jossl. that setup worked with websphere - websphere can NOT load those jar from within a jar ! since all nested jars are coming from gem, the stripped jruby-stdlib will help. |
there are classloaders (OSGI or some j2ee classloaders) where directory globbing does not work. this means it is already difficult to embed gems in jar/war which works with those classloaders - the trick is do something similar what but we the default gems remain a problem since inside those classloaders rubygems can NOT find the files in META-INF/jruby.home/lib/ruby/gems/shared/sepcifications/default/ . i.e. it is the exact same situation is in #1706 well let's look at our artifacts: the actual change is rather small: to declare gem dependencies in jruby-stdlib those gems needs to be on oss.sonatype.org - a while ago I asked them if it is possible to deploy gems on maven central: the jruby-stdlib will be build in lib/ and maven/jruby-stdlib can go away. in the end we get on less maven module ;) regarding OSGi this is only a partial solution - it works when you add jruby/jruby-noasm to your bundle and trick a little when embedding gems into your jar. but it does not help with jruby-complete which is also an OSGi bundle I can provide integration-tests for the OSGi case which most probably ensures that this "feature" will work on any j2ee classloader as well. /cc @ratnikov |
just wanted to add some more after a discussion with @ratnikov the default gems issue I see especially on websphere especially indeed be just LOAD_PATH problem which is caused by jruby-rack (I am already using a patched jruby-rack since it plays around to much with CWD, GEM_PATH, LOAD_PATH and maybe other things) with OSGi I have classloader which does not use URLClassloader BUT where there is NO fiddling on the ruby side of things. and it is easy to setup integration tests for it - we have already one testing that openssl at least loads (since 1.7.11 or so). if OSGi works then a war-file should also work since a war-file is just a jar where the classes are located in /WEB-INF/classes instead of / |
jruby-stdlib will add extra directory listing info:c04c50f#diff-94623248443d235e4cf2485d3fcc240aR77 |
some (or all) osgi classloaders and some j2ee classloaders do not work with rubygems at all. the reason is that rubygems needs to "browse" the directory structure to find the specifications/* or the specifications/default/* - a classloader does not offer such an API for doing so. i.e. there are NO installed gems and there are NO default gems with jruby coming from such a classloader !
what I did with OSGi is to unwrap the gems, i.e. copy the "lib" directory of gem into the root of the jar (gem-maven-plugin has such feature now). that helps until now.
BUT the default gems logic only works if those specifications/default/* can found otherwise you can not "overwrite" for example jruby-openssl, since these files will be just treated as regular files of the stdlib.
a possible solution would be to stdlib without those default gems bundled but with dependencies towards those default gems. dito with jruby-jars having a stripped jruby-stdlib with explicit deps of default gems would help warbler - not sure about ruboto's use of jruby-jars
The text was updated successfully, but these errors were encountered: