Created
June 6, 2013 19:26
-
-
Save crazed/5724192 to your computer and use it in GitHub Desktop.
jruby null pointer exception
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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