Prevent stackoverflow when migrating with jruby