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

GroovyServlet script resolving broken

Agile BoardAttach filesAttach ScreenshotAdd voteVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.8.8, 2.0.5, 2.3.0
    • None
    • Groovlet / GSP
    • None

    Description

      When using groovy script with the GroovyServlet, script resolving is currently broken. It works the first time, but as soon as the entry is cached, resolving no longer works. groovy.servlet.AbstractHttpServlet tries to resolve the script file in order to determine the last modification time, but fails to do this with file: URLs.

      This commit breaks the resource loading in groovy.servlet.AbstractHttpServlet:
      https://github.com/groovy/groovy-core/commit/e941c940655bbdf0b62c60ff02754e993394b3a8#src/main/groovy/util/GroovyScriptEngine.java

      The commit above changed the path being used for resource loading to a full URL with a file: scheme, which is not taken into account when loading resources in groovy.servlet.AbstractHttpServlet.getResourceConnection(String)

      An easy fix would be to change groovy.servlet.AbstractHttpServlet to parse the provided name as URI and get the path from it.

      Attachments

        1. abc.groovy
          0.1 kB
          Wolfgang Schell
        2. Bug5935Main.groovy
          0.8 kB
          Wolfgang Schell
        3. GroovyNotFound.war
          6.79 MB
          Guy Rouillier

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            jetztgradnet Wolfgang Schell

            Dates

              Created:
              Updated:

              Slack

                Issue deployment