Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: JRuby 1.4, JRuby 1.5.0.RC1, JRuby 1.5.0.RC2
    • Fix Version/s: JRuby 1.6RC1
    • Component/s: None
    • Labels:
      None
    • Environment:
      ubuntu server 10.04
      jruby 1.5.0.RC1
      java 1.6.0_u20
      glassfish v3
      rails 2.3.5
    • Number of attachments :
      1

      Description

      while starting, Glassfish failing to load JRUBY with the following errors:

      [#|2010-05-10T20:28:11.613+0300|SEVERE|glassfishv3.0|org.glassfish.scripting.jruby.JRubyContainer|_ThreadID=23;_ThreadName=Thread-1;|library `socket' could not be loaded: java.lang.LinkageError: loader (instance of java/net/URLClassLoader): attempted duplicate class definition for name: "org/jruby/ext/socket/RubySocket"
      from /usr/local/lib/jruby-1.5.0.RC1/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:134:in `process'
      from /usr/local/lib/jruby-1.5.0.RC1/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:113:in `run'
      from /opt/glassfishv3/glassfish/domains/domain1/applications/apa/config/environment.rb:9
      from /opt/glassfishv3/glassfish/domains/domain1/applications/apa/config/environment.rb:31:in `require'
      from /usr/local/lib/jruby-1.5.0.RC1/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
      from file:/opt/glassfishv3/glassfish/modules/grizzly-jruby.jar!/rack/adapter/rails.rb:98:in `load_application'
      from file:/opt/glassfishv3/glassfish/modules/grizzly-jruby.jar!/rack/adapter/rails.rb:75:in `initialize'
      from file:/opt/glassfishv3/glassfish/modules/grizzly-jruby.jar!/jruby/rack/rails.rb:25:in `new'
      from file:/opt/glassfishv3/glassfish/modules/grizzly-jruby.jar!/jruby/rack/rails.rb:25:in `new'
      from <script>:1

      /usr/local/lib/jruby-1.5.0.RC1/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:271:in `require_frameworks': library `socket' could not be loaded: java.lang.LinkageError: loader (instance of java/net/URLClassLoader): attempted duplicate class definition for name: "org/jruby/ext/socket/RubySocket" (RuntimeError)
      from /usr/local/lib/jruby-1.5.0.RC1/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:134:in `process'
      from /usr/local/lib/jruby-1.5.0.RC1/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:113:in `run'
      from /opt/glassfishv3/glassfish/domains/domain1/applications/apa/config/environment.rb:9
      from /opt/glassfishv3/glassfish/domains/domain1/applications/apa/config/environment.rb:31:in `require'
      from /usr/local/lib/jruby-1.5.0.RC1/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
      from file:/opt/glassfishv3/glassfish/modules/grizzly-jruby.jar!/rack/adapter/rails.rb:98:in `load_application'
      from file:/opt/glassfishv3/glassfish/modules/grizzly-jruby.jar!/rack/adapter/rails.rb:75:in `initialize'
      from file:/opt/glassfishv3/glassfish/modules/grizzly-jruby.jar!/jruby/rack/rails.rb:25:in `new'
      from file:/opt/glassfishv3/glassfish/modules/grizzly-jruby.jar!/jruby/rack/rails.rb:25:in `new'
      from <script>:1
      ...internal jruby stack elided...
      from Rails::Initializer.require_frameworks(/usr/local/lib/jruby-1.5.0.RC1/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:134)
      from Rails::Initializer.process(/usr/local/lib/jruby-1.5.0.RC1/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:113)
      from #<Class:01x5a372f43>.run(/opt/glassfishv3/glassfish/domains/domain1/applications/apa/config/environment.rb:9)
      from (unknown).(unknown)(/opt/glassfishv3/glassfish/domains/domain1/applications/apa/config/environment.rb:31)
      from Kernel.require(/usr/local/lib/jruby-1.5.0.RC1/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31)
      from Kernel.require(file:/opt/glassfishv3/glassfish/modules/grizzly-jruby.jar!/rack/adapter/rails.rb:98)
      from Rack::Adapter::Rails.load_application(file:/opt/glassfishv3/glassfish/modules/grizzly-jruby.jar!/rack/adapter/rails.rb:75)
      from Rack::Adapter::Rails.initialize(file:/opt/glassfishv3/glassfish/modules/grizzly-jruby.jar!/jruby/rack/rails.rb:25)
      from (unknown).new(file:/opt/glassfishv3/glassfish/modules/grizzly-jruby.jar!/jruby/rack/rails.rb:25)
      from #<Class:01x330a9da7>.new(<script>:1)
      from (unknown).(unknown)(:1)

      #]

        Activity

        Hide
        Hiro Asari added a comment -

        Workaround is http://github.com/jruby/jruby/commit/282126570e79430f48c2a9b925effe03cf2d4fe6

        This is not in the 1.5 branch. Can you try the snapshot from http://ci.jruby.org/snapshots/ and see if it fixes your problem?

        Show
        Hiro Asari added a comment - Workaround is http://github.com/jruby/jruby/commit/282126570e79430f48c2a9b925effe03cf2d4fe6 This is not in the 1.5 branch. Can you try the snapshot from http://ci.jruby.org/snapshots/ and see if it fixes your problem?
        Hide
        Alan O'Leary added a comment -

        I can confirm that both workarounds worked independently

        1) Downgrading to b17 worked

        or

        2) Using the latests 1.6.0.dev snapshot

        Having both of those for now should help most people until a final 1.6.0 is released

        Thanks - A

        Show
        Alan O'Leary added a comment - I can confirm that both workarounds worked independently 1) Downgrading to b17 worked or 2) Using the latests 1.6.0.dev snapshot Having both of those for now should help most people until a final 1.6.0 is released Thanks - A
        Hide
        Charles Oliver Nutter added a comment -

        Fixed in 1.6 (and I think in 1.5.2 or 1.5.3), workaround is to downgrade Java version.

        Show
        Charles Oliver Nutter added a comment - Fixed in 1.6 (and I think in 1.5.2 or 1.5.3), workaround is to downgrade Java version.
        Hide
        asbrus putin added a comment -

        I'm trying to get this to work. Can someone please explain how to download my Java version, or download the new Jruby1.6 version?

        Show
        asbrus putin added a comment - I'm trying to get this to work. Can someone please explain how to download my Java version, or download the new Jruby1.6 version?
        Hide
        gab added a comment -

        Found remaining inner classes, which cause problems running Redmine on JRuby and Glassfish. The attached patch moves the inner classes of org.jruby.util.ReferenceReaper into top level classes PhantomReferenceReaper, SoftReferenceReaper and WeakReferenceReaper.
        Please note I don't have any significant knowledge about JRuby, nor git.

        Show
        gab added a comment - Found remaining inner classes, which cause problems running Redmine on JRuby and Glassfish. The attached patch moves the inner classes of org.jruby.util.ReferenceReaper into top level classes PhantomReferenceReaper, SoftReferenceReaper and WeakReferenceReaper. Please note I don't have any significant knowledge about JRuby, nor git.

          People

          • Assignee:
            Charles Oliver Nutter
            Reporter:
            robot ebobot
          • Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: