iconara / rubydoop

Write Hadoop jobs in JRuby
220 stars 33 forks source link

Ruby.defineReadonlyVariable undefined on jruby 1.7.3 #6

Closed jedisct1 closed 11 years ago

jedisct1 commented 11 years ago

Rubydoop fails on jruby 1.7.3:

Exception in thread "main" java.lang.NoSuchMethodError: org.jruby.Ruby.defineReadonlyVariable(Ljava/lang/String;Lorg/jruby/runtime/builtin/IRubyObject;)V
    at rubydoop.RubydoopJobRunner.configureJobs(RubydoopJobRunner.java:57)
jedisct1 commented 11 years ago

Looks like the method now takes a 3rd argument, which is the scope:

-        runtime.defineReadonlyVariable("$rubydoop_context", contextInstance);
+        runtime.defineReadonlyVariable("$rubydoop_context", contextInstance, org.jruby.internal.runtime.GlobalVariable.Scope.GLOBAL);
iconara commented 11 years ago

Thanks. I'll have to look into that. I should probably switch back to ScriptingContainer.

iconara commented 11 years ago

I've rewritten the embedding code, try v1.1.0.pre3, it should work with JRuby 1.7.3.