jruby-rack
  1. jruby-rack
  2. JRUBY_RACK-18

undefined method `new' for "Rack::Lock":String with Warbler 1.0.0 + JRuby 1.3.0 + Rails 2.3.2

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.9.4
    • Fix Version/s: 0.9.5
    • Labels:
      None

      Description

      This bug was already open in jruby jira but it's a jruby-rack issue:

      http://jira.codehaus.org/browse/JRUBY-3789

      Jruby-rack raises this error with glassfish and tomcat at least:

      Caused by: org.jruby.rack.RackInitializationException: undefined method `new' for "Rack::Lock":String
      from /Users/arungupta/tools/glassfish/v2.1/glassfish/nodeagents/cloud-nodeagent/cabernet/app
      lications/j2ee-modules/helloworld/WEB-INF/gems/gems/actionpack-2.3.2/lib/action_controller/middlewar
      e_stack.rb:116:in `inject'
      from /Users/arungupta/tools/glassfish/v2.1/glassfish/nodeagents/cloud-nodeagent/cabernet/app
      lications/j2ee-modules/helloworld/WEB-INF/gems/gems/actionpack-2.3.2/lib/action_controller/middlewar
      e_stack.rb:116:in `build'
      from /Users/arungupta/tools/glassfish/v2.1/glassfish/nodeagents/cloud-nodeagent/cabernet/app
      lications/j2ee-modules/helloworld/WEB-INF/gems/gems/actionpack-2.3.2/lib/action_controller/dispatche
      r.rb:82:in `initialize'
      from /Users/arungupta/tools/glassfish/v2.1/glassfish/nodeagents/cloud-nodeagent/cabernet/app
      lications/j2ee-modules/helloworld/WEB-INF/gems/gems/actionpack-2.3.2/lib/action_controller/dispatche
      r.rb:52:in `run_prepare_callbacks'

        Activity

        Hide
        David Calavera added a comment -

        Well after dive into jruby-rack code and jar file finally I found the problem.

        jruby-rack-0.9.4.jar doesn't contain rack/lock.rb!!! that's it.

        Rack::Lock is just used with some database adapters that's the reason why it just crashes sometimes.

        Show
        David Calavera added a comment - Well after dive into jruby-rack code and jar file finally I found the problem. jruby-rack-0.9.4.jar doesn't contain rack/lock.rb!!! that's it. Rack::Lock is just used with some database adapters that's the reason why it just crashes sometimes.
        Hide
        Nick Sieger added a comment -

        This is resolved with 0.9.5, but...

        If jruby-rack didn't bundle its own version of Rack this wouldn't be an issue and people could choose whatever version of Rack was suitable for their environment.

        Show
        Nick Sieger added a comment - This is resolved with 0.9.5, but... If jruby-rack didn't bundle its own version of Rack this wouldn't be an issue and people could choose whatever version of Rack was suitable for their environment.
        Hide
        David Calavera added a comment -

        Agree, actually as jruby-rack user I didn't mind to have that dependency, I mean, warble already vendorize rack gem and it could be a requirement for jruby-rack custom usages.

        Show
        David Calavera added a comment - Agree, actually as jruby-rack user I didn't mind to have that dependency, I mean, warble already vendorize rack gem and it could be a requirement for jruby-rack custom usages.
        Hide
        arungupta added a comment -

        Is there a known workaround to this problem ?

        Show
        arungupta added a comment - Is there a known workaround to this problem ?
        Show
        David Calavera added a comment - you can use a 0.9.5 snapshot http://snapshots.repository.codehaus.org/org/jruby/rack/jruby-rack/0.9.5-SNAPSHOT/jruby-rack-0.9.5-20090625.190033-5.jar
        Hide
        arungupta added a comment -

        Gary Weaver suggested the following work around:

        – cut here –
        Having trouble getting into Kenai at the moment, but the workaround to your issue below should be to use the latest jruby-rack. How to override the one packaged in warbler is:

        1. Additional Java .jar files to include. Note that if .jar files are placed
        2. in lib (and not otherwise excluded) then they need not be mentioned here.
        3. JRuby and JRuby-Rack are pre-loaded in this list. Be sure to include your
        4. own versions if you directly set the value
        5. config.java_libs += FileList["lib/java/*.jar"]
          config.java_libs.delete_if {|f| f =~ /jruby-rack/ || f =~ /jruby-complete/ }

          config.java_libs += FileList["lib/jruby-complete*.jar"]
          config.java_libs += FileList["lib/jruby-rack*.jar"]

        then put the jruby-rack and jruby-complete jars you want to use in the lib/ dir.

        The jruby-rack snapshot containing this fix is:
        http://snapshots.repository.codehaus.org/org/jruby/rack/jruby-rack/0.9.5-SNAPSHOT/jruby-rack-0.9.5-20090625.190033-5.jar

        You'll need to find the jruby jar you want to use and put it in the lib dir or remove that part from above.

        My related blog entries:
        http://stufftohelpyouout.blogspot.com/2009/07/fix-ioerrorio-errorbroken-pipestrange.html
        http://stufftohelpyouout.blogspot.com/2009/06/how-to-get-warbler-to-include-custom.html

        If you could post this into the Kenai ticket if it works for you, that would be great.
        – cut here –

        Show
        arungupta added a comment - Gary Weaver suggested the following work around: – cut here – Having trouble getting into Kenai at the moment, but the workaround to your issue below should be to use the latest jruby-rack. How to override the one packaged in warbler is: Additional Java .jar files to include. Note that if .jar files are placed in lib (and not otherwise excluded) then they need not be mentioned here. JRuby and JRuby-Rack are pre-loaded in this list. Be sure to include your own versions if you directly set the value config.java_libs += FileList ["lib/java/*.jar"] config.java_libs.delete_if {|f| f =~ /jruby-rack/ || f =~ /jruby-complete/ } config.java_libs += FileList ["lib/jruby-complete*.jar"] config.java_libs += FileList ["lib/jruby-rack*.jar"] then put the jruby-rack and jruby-complete jars you want to use in the lib/ dir. The jruby-rack snapshot containing this fix is: http://snapshots.repository.codehaus.org/org/jruby/rack/jruby-rack/0.9.5-SNAPSHOT/jruby-rack-0.9.5-20090625.190033-5.jar You'll need to find the jruby jar you want to use and put it in the lib dir or remove that part from above. My related blog entries: http://stufftohelpyouout.blogspot.com/2009/07/fix-ioerrorio-errorbroken-pipestrange.html http://stufftohelpyouout.blogspot.com/2009/06/how-to-get-warbler-to-include-custom.html If you could post this into the Kenai ticket if it works for you, that would be great. – cut here –
        Hide
        gswduke added a comment -

        (just got my Kenai acct. stuff straightened out)

        A few more notes about the workaround:

        • Do warble war:clean first to make sure it removes previous versions of jruby-rack, or it won't fix it (I did that. ugh!).
        • Nick was the one who described how to do this for me and told me that the new jar fixed it (and he noted that in the ticket also).

        Gary

        Show
        gswduke added a comment - (just got my Kenai acct. stuff straightened out) A few more notes about the workaround: Do warble war:clean first to make sure it removes previous versions of jruby-rack, or it won't fix it (I did that. ugh!). Nick was the one who described how to do this for me and told me that the new jar fixed it (and he noted that in the ticket also). Gary
        Hide
        Nick Sieger added a comment -

        As of 7a14ac4, JRuby-Rack allows a newer rack to be loaded and doesn't force its vendored copy on you.

        Show
        Nick Sieger added a comment - As of 7a14ac4, JRuby-Rack allows a newer rack to be loaded and doesn't force its vendored copy on you.

          People

          • Assignee:
            Unassigned
            Reporter:
            David Calavera
          • Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: