Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: JRuby 1.5.5
    • Fix Version/s: JRuby 1.6RC2
    • Component/s: Rails WAR Deployment
    • Labels:
      None
    • Environment:
      Windows 7, Weblogic 10.3.2.0, JRuby 1.5.5, Rail 3.0.3
    • Number of attachments :
      0

      Description

      I'm having trouble getting JRuby, Warble & Weblogic 10 to play nicely together.

      I followed this example (http://kenai.com/projects/jruby/pages/JRubyOnRailsOnBEAWeblogic) to create a JRuby/Rails project, package to a .war file, and deploy to WebLogic 10. Everything looks good and the .war file deploys, but after making a request, I get this stacktrace.

      I've seen others with similar issues related to initializing Rack, but no one with this "unknown error."

      <Nov 29, 2010 5:27:02 PM EST> <Notice> <WebLogicServer> <BEA-000360> <Server sta
      rted in RUNNING mode>
      <Nov 29, 2010 5:30:16 PM EST> <Warning> <netuix> <BEA-423420> <Redirect is execu
      ted in begin or refresh action. Redirect url is /console/console.portal?_nfpb=tr
      ue&_pageLabel=WebAppApplicationOverviewPage&WebAppApplicationOverviewPortlethand
      le=com.bea.console.handles.AppDeploymentHandle%28%22com.bea%3AName%3DPARails%2CT
      ype%3DAppDeployment%22%29.>
      <Nov 29, 2010 5:32:55 PM EST> <Error> <ServletContext-/PARails> <BEA-000000> <Ap
      plication Error
      org.jruby.rack.RackInitializationException: Unknown error - Unknown Error (20047
      ) - C:\PA\PADomain\servers\AdminServer\stage\PARails\PARails\WEB-INF\classpath:
      from classpath:/META-INF/jruby.home/lib/ruby/1.8/fileutils.rb:217:in `mk
      dir_p'
      from classpath:/META-INF/jruby.home/lib/ruby/1.8/fileutils.rb:215:in `re
      verse_each'
      from classpath:/META-INF/jruby.home/lib/ruby/1.8/fileutils.rb:215:in `mk
      dir_p'
      from classpath:/META-INF/jruby.home/lib/ruby/1.8/fileutils.rb:201:in `ea
      ch'
      from classpath:/META-INF/jruby.home/lib/ruby/1.8/fileutils.rb:201:in `mk
      dir_p'
      from C:/PA/PADomain/servers/AdminServer/stage/PARails/PARails/WEB-INF/ge
      ms/gems/bundler-1.0.7/lib/bundler.rb:259:in `configure_gem_home_and_path'
      from C:/PA/PADomain/servers/AdminServer/stage/PARails/PARails/WEB-INF/ge
      ms/gems/bundler-1.0.7/lib/bundler.rb:72:in `configure'
      from C:/PA/PADomain/servers/AdminServer/stage/PARails/PARails/WEB-INF/ge
      ms/gems/bundler-1.0.7/lib/bundler.rb:126:in `definition'
      ... 9 levels...
      from classpath:/vendor/rack-1.2.1/rack/builder.rb:46:in `initialize'
      from <script>:2:in `new'
      from <script>:2

      at org.jruby.rack.DefaultRackApplicationFactory$4.init(DefaultRackApplic
      ationFactory.java:184)
      at org.jruby.rack.DefaultRackApplicationFactory.getApplication(DefaultRa
      ckApplicationFactory.java:59)
      at org.jruby.rack.PoolingRackApplicationFactory.getApplication(PoolingRa
      ckApplicationFactory.java:94)
      at org.jruby.rack.servlet.DefaultServletDispatcher.process(DefaultServle
      tDispatcher.java:36)
      at org.jruby.rack.RackFilter.doFilter(RackFilter.java:59)
      Truncated. see log file for complete stacktrace

      Caused By: org.jruby.exceptions.RaiseException: Unknown error - Unknown Error (2
      0047) - C:\PA\PADomain\servers\AdminServer\stage\PARails\PARails\WEB-INF\classpa
      th:
      at (unknown).new(classpath:/META-INF/jruby.home/lib/ruby/1.8/fileutils.r
      b:243)
      at FileUtils.fu_mkdir(classpath:/META-INF/jruby.home/lib/ruby/1.8/fileut
      ils.rb:217)
      at FileUtils.mkdir_p(classpath:/META-INF/jruby.home/lib/ruby/1.8/fileuti
      ls.rb:215)
      at Array.reverse_each(classpath:/META-INF/jruby.home/lib/ruby/1.8/fileut
      ils.rb:215)
      at FileUtils.mkdir_p(classpath:/META-INF/jruby.home/lib/ruby/1.8/fileuti
      ls.rb:201)
      Truncated. see log file for complete stacktrace
      >

        Activity

        Hide
        Dwayne Litzenberger added a comment -

        I printed out ENV['GEM_HOME'] in config/boot.rb, just before the Bundler stuff is loaded. It's nil.

        See my dummy Rails project at https://github.com/dlitz/dummy-jruby-5219

        Show
        Dwayne Litzenberger added a comment - I printed out ENV ['GEM_HOME'] in config/boot.rb, just before the Bundler stuff is loaded. It's nil. See my dummy Rails project at https://github.com/dlitz/dummy-jruby-5219
        Hide
        Dwayne Litzenberger added a comment - - edited

        So bundler-1.0.7/lib/bundler.rb, around line 87, contains this code:

        def bundle_path
          # STDERR.puts settings.path
          @bundle_path ||= Pathname.new(settings.path).expand_path(root)
        end
        

        settings.path is "classpath:/META-INF/jruby.home/lib/ruby/gems/1.8"

        so @bundle_path becomes #<Pathname:C:/glassfishv3/glassfish/domains/domain1/applications/dummy/WEB-INF/classpath:/META-INF/jruby.home/lib/ruby/gems/1.8>

        Show
        Dwayne Litzenberger added a comment - - edited So bundler-1.0.7/lib/bundler.rb, around line 87, contains this code: def bundle_path # STDERR.puts settings.path @bundle_path ||= Pathname. new (settings.path).expand_path(root) end settings.path is "classpath:/META-INF/jruby.home/lib/ruby/gems/1.8" so @bundle_path becomes #<Pathname:C:/glassfishv3/glassfish/domains/domain1/applications/dummy/WEB-INF/classpath:/META-INF/jruby.home/lib/ruby/gems/1.8>
        Hide
        Dwayne Litzenberger added a comment -

        On Windows+Glassfish, we get an exception, but on OSX+Glassfish, we don't. It's not because this is a Windows-specific bug, but because OSX lets you create directories with colons in them.

        Here's the WEB-INF directory where Glassfish explodes the .war file, after deployment:

        $ ls -tF WEB-INF
        log/          classpath:/   lib/          web.xml       gems/         Gemfile       Gemfile.lock  app/          config/
        

        That "classpath:" directory isn't in the .war file itself; it's being created at runtime.

        Show
        Dwayne Litzenberger added a comment - On Windows+Glassfish, we get an exception, but on OSX+Glassfish, we don't. It's not because this is a Windows-specific bug, but because OSX lets you create directories with colons in them. Here's the WEB-INF directory where Glassfish explodes the .war file, after deployment: $ ls -tF WEB-INF log/ classpath:/ lib/ web.xml gems/ Gemfile Gemfile.lock app/ config/ That "classpath:" directory isn't in the .war file itself; it's being created at runtime.
        Hide
        Nick Sieger added a comment -

        I'm going to go out on a limb and guess that this bug can be reduced to the following:

        File.expand_path("classpath:/META-INF/jruby.home") != "classpath:/META-INF/jruby.home"
        

        There could be a separate bug here that causes JRuby to select the classpath: version of jruby.home, but if at least paths are not expanded improperly things should have a much better chance of working.

        Show
        Nick Sieger added a comment - I'm going to go out on a limb and guess that this bug can be reduced to the following: File.expand_path("classpath:/META-INF/jruby.home") != "classpath:/META-INF/jruby.home" There could be a separate bug here that causes JRuby to select the classpath: version of jruby.home , but if at least paths are not expanded improperly things should have a much better chance of working.
        Hide
        Nick Sieger added a comment -

        Fixed the expand_path issue in 7a8aec52, let's hope that addresses this problem.

        Show
        Nick Sieger added a comment - Fixed the expand_path issue in 7a8aec52, let's hope that addresses this problem.

          People

          • Assignee:
            Nick Sieger
            Reporter:
            J. Atwood
          • Votes:
            5 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: