Skip to content

Instantly share code, notes, and snippets.

@crazed
Created June 6, 2013 19:26
Show Gist options
  • Select an option

  • Save crazed/5724192 to your computer and use it in GitHub Desktop.

Select an option

Save crazed/5724192 to your computer and use it in GitHub Desktop.
jruby null pointer exception
private JRubyInterceptor(String scriptPath, String className) {
this.scriptPath = scriptPath;
this.className = className;
try {
logger.info("Trying to read ruby script from " + scriptPath);
Reader reader = new FileReader(scriptPath);
jruby.eval(new BufferedReader(reader));
logger.info("Trying to create our interceptor class by evaluating " + className + ".new");
this.rubyInterceptor = jruby.eval(className + ".new");
} catch (FileNotFoundException e) {
throw new IllegalArgumentException("Script file not found: " + scriptPath, e);
} catch (ScriptException e) {
throw new IllegalArgumentException("Error executing script: " + scriptPath, e);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment