-
-
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
ScriptingContainer with LocalContextScope.THREADSAFE share JRubyClassLoader with all runtimes #2561
Comments
does this issue imply that a java application server like glassfish cant run several different apps with several different versions of jruby/openssl/BC? |
@joedaniels29 the above problem is when you have several jruby runtimes (or ScriptingContainers) inside one classloader. all those runtimes share a child classloader the JRubyClassloader. with this JRubyClassLoader requiring BC and all the other jars needs to be synchroinized. having several webapps inside a servlet engine are nicely separated and can run different versions of jruby or BC, etc. |
two possible implementations:
@kares would appreciate your input here :) |
@mkristian aah, get it now - thanks for the explanation. never realised the case but it makes sense. |
@kares for me 1) is the only clean solution - let me see what it needs and then we look at the "risk" |
I looked into this and the following class can reproduce it with jruby-1_7
I used jruby-complete.jar and this class one the classpath. with jruby-9k I do not see the error. apparently then I created the issue something was really obvious for me BUT I can not see anything why the JRubyClassLoaders are not separated :( since jruby-9k does not see the original error I am inclined to "won't fix" it on jruby-1_7 and close the issue. beside this I still think this issue is related to jruby/warbler#356 |
@mkristian thanks, as I quickly looked through jruby-rack I did not find how you'd like to proceed on 1) |
it works on jruby-9k and as an etch-case I am closing it |
ScriptingContainer with LocalContextScope.THREADSAFE share one instance of JRubyClassLoader with all runtimes. since each runtime loads it own set of jar files but they get shared by the shared JRubyClassLoader. for example each runtime can load its own version of bouncycastle jars which will result one classloader having all those BC jars loaded.
the real world problem is when a lot of thread startup with
require 'openssl'
conditions can arise where some classes can not be loaded from the JRubyClassLoader: http://ruby.11.x6.nabble.com/JRuby-complete-multi-threading-and-java-lang-NoClassDefFoundError-td5004808.htmlIMO each runtime should have its own JRubyClassloader to separate the set if required jars per runtime.
The text was updated successfully, but these errors were encountered: