Skip to content

Commit e063c55

Browse files
committed
putting the jruby-classloader as context classloader means that all attached "jars" can be found via
the Thread.currentThread.contextClassLoader. running jruby from other environments like servlets just leave the context classloader as is. so this was a commandline only feature. finally it keeps the classloader semantic uniform wether executed from commandline or inside a j2ee container or osgi framework or embedded jruby in a java application
1 parent e09f484 commit e063c55

File tree

1 file changed

+0
-14
lines changed

1 file changed

+0
-14
lines changed

core/src/main/java/org/jruby/Main.java

-14
Original file line numberDiff line numberDiff line change
@@ -283,8 +283,6 @@ public void run() {
283283
}
284284

285285
try {
286-
doSetContextClassLoader(runtime);
287-
288286
if (in == null) {
289287
// no script to run, return success
290288
return new Status();
@@ -452,18 +450,6 @@ private boolean checkStreamSyntax(Ruby runtime, InputStream in, String filename)
452450
}
453451
}
454452

455-
private void doSetContextClassLoader(Ruby runtime) {
456-
// set thread context JRuby classloader here, for the main thread
457-
try {
458-
Thread.currentThread().setContextClassLoader(runtime.getJRubyClassLoader());
459-
} catch (SecurityException se) {
460-
// can't set TC classloader
461-
if (runtime.getInstanceConfig().isVerbose()) {
462-
config.getError().println("WARNING: Security restrictions disallowed setting context classloader for main thread.");
463-
}
464-
}
465-
}
466-
467453
private void doProcessArguments(InputStream in) {
468454
config.processArguments(config.parseShebangOptions(in));
469455
}

0 commit comments

Comments
 (0)