Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-3711

NPE when using JSR223 implementation under some conditions

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.6.4
    • 1.6.5, 1.7-beta-2
    • JSR / TCK / GLS
    • None

    Description

      Example:

      import java.lang.*
      

      This causes:

      ...
      Caused by: javax.script.ScriptException
      	at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:306)
      	at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:113)
      	... 92 more
      Caused by: java.lang.NullPointerException
      	at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:253)
      

      The reason is that GroovyScriptEngineImpl.getScriptClass() returns null in this case (I tried to understand why but couldn't).
      Since it's null the eval() method fails at line 253.

      Note that there was another error hiding this error, this time caused by livetribe, which is now fixed in livetribe 2.0.6. You can see more information here:
      http://jira.xwiki.org/jira/browse/XWIKI-4246

      Thanks

      Attachments

        1. 17x_Patch.txt
          3 kB
          Roshan Dawrani

        Activity

          People

            roshandawrani Roshan Dawrani
            vmassol Vincent Massol
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: