JRuby (please use github issues at http://bugs.jruby.org)
  1. JRuby (please use github issues at http://bugs.jruby.org)
  2. JRUBY-6339

JRuby can't load from JAR files on a path with a '#' symbol (breaks Tomcat 7 Parallel Deployment)

    Details

    • Number of attachments :
      0

      Description

      Tomcat 7 parallel deployment indicates versioned WARs by placing a ##VERSION suffix on the WAR file, e.g, my-app##001.war. (http://tomcat.apache.org/tomcat-7.0-doc/config/context.html#Parallel_deployment)

      When deploying a JRuby on Rails packaged with Warbler, this results in a RackInitializationException, the root cause of which is a MalformedURLException thrown from line 1146 of org.jruby.runtime.load.LoadService.java. The malformed url looks like "jar:file:/opt/apache-tomcat-7.0.23/webapps/my-app##001/WEB-INF/lib/jruby-rack-1.1.2.jar!/vendor/rack-1.3.6/rack.rb".

      That this is a malformed URL can be verified by simply passing the string to the constructor of java.net.URL: it will throw a MalformedURLException. Everything after the sharp symbol is being interpreted as a fragment rather than part of the file path.

      One possible solution is to escape the sharp signs in a file path using standard URL escaping. '##' becomes '%23%23'. Experimentation confirms that Java is capable of parsing and reading from the example URL given above when it is escaped in this way.

        Activity

        Hiro Asari made changes -
        Field Original Value New Value
        Priority Major [ 3 ] Critical [ 2 ]
        Hiro Asari made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Assignee Hiro Asari [ asari ]
        Fix Version/s JRuby 1.7.1 [ 18842 ]
        Resolution Fixed [ 1 ]

          People

          • Assignee:
            Hiro Asari
            Reporter:
            Luke VanderHart
          • Votes:
            2 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: