Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jruby/jruby
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 41393080585a
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 32926ac194c0
Choose a head ref
  • 2 commits
  • 1 file changed
  • 2 contributors

Commits on Nov 17, 2016

  1. Fix JRuby embed crash after application reloading

    We use JRuby `ScriptingContainer` in a tomcat servlet web
    application.  After application reloading in tomcat, JRuby
    runtime initialization fails with the error message.
    "BUG: could not initialize constructor handle"
    
    `MethodHandles.publicLookup().findConstructor()` fails with
    `IllegalAccessException` in static initialization block.
    
    The initialization does not work well with tomcat reloading.
    
    As a workaround `MethodHandles.lookup()` without access check
    works fine.
    shirosaki committed Nov 17, 2016
    Copy the full SHA
    e37513b View commit details

Commits on Feb 24, 2017

  1. Merge pull request #4312 from shirosaki/embed_reload

    Fix JRuby embed crash after application reloading
    headius authored Feb 24, 2017
    Copy the full SHA
    32926ac View commit details
Showing with 2 additions and 1 deletion.
  1. +2 −1 core/src/main/java/org/jruby/runtime/scope/ManyVarsDynamicScope.java
Original file line number Diff line number Diff line change
@@ -32,7 +32,8 @@ public class ManyVarsDynamicScope extends DynamicScope {
public static final MethodHandle CONSTRUCTOR;
static {
try {
CONSTRUCTOR = MethodHandles.publicLookup()
// use lookup() to avoid IllegalAccessException with JRuby embed
CONSTRUCTOR = MethodHandles.lookup()
.findConstructor(ManyVarsDynamicScope.class, MethodType.methodType(void.class, StaticScope.class, DynamicScope.class))
.asType(MethodType.methodType(DynamicScope.class, StaticScope.class, DynamicScope.class));
} catch (Exception e) {