nil exception for http.rb
-------------------------

                 Key: JRUBY-4845
                 URL: http://jira.codehaus.org/browse/JRUBY-4845
             Project: JRuby
          Issue Type: Bug
          Components: Standard Library
    Affects Versions: JRuby 1.5
            Reporter: Antoine Toulme
            Assignee: Thomas E Enebo


Got this stacktrace repeatedly with Buildr:

undefined method `closed?' for nil:NilClass
/shared/common/jruby-1.5.0/lib/ruby/1.8/net/http.rb:1060:in `request'
/opt/public/common/jruby-1.5.0/lib/ruby/gems/1.8/gems/buildr-1.4.0-java/lib/buildr/core/transports.rb:281:in
 `read'
/opt/public/common/jruby-1.5.0/lib/ruby/gems/1.8/gems/buildr-1.4.0-java/lib/buildr/core/transports.rb:371:in
 `connect'
/opt/public/common/jruby-1.5.0/lib/ruby/gems/1.8/gems/buildr-1.4.0-java/lib/buildr/core/transports.rb:276:in
 `read'
/opt/public/common/jruby-1.5.0/lib/ruby/gems/1.8/gems/buildr-1.4.0-java/lib/buildr/core/transports.rb:152:in
 `download'
/opt/public/common/jruby-1.5.0/lib/ruby/gems/1.8/gems/buildr-1.4.0-java/lib/buildr/core/transports.rb:77:in
 `download'
/opt/public/common/jruby-1.5.0/lib/ruby/gems/1.8/gems/buildr-1.4.0-java/lib/buildr/packaging/artifact.rb:384:in
 `download'
/opt/public/common/jruby-1.5.0/lib/ruby/gems/1.8/gems/buildr-1.4.0-java/lib/buildr/packaging/artifact.rb:381:in
 `find'
/opt/public/common/jruby-1.5.0/lib/ruby/gems/1.8/gems/buildr-1.4.0-java/lib/buildr/packaging/artifact.rb:381:in
 `download'
/opt/public/common/jruby-1.5.0/lib/ruby/gems/1.8/gems/buildr-1.4.0-java/lib/buildr/packaging/artifact.rb:329:in
 `initialize'
/opt/public/common/jruby-1.5.0/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in
 `call'
/opt/public/common/jruby-1.5.0/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in
 `execute'
/opt/public/common/jruby-1.5.0/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in
 `each'
/opt/public/common/jruby-1.5.0/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in
 `execute'

The code raising the error:
rescue => exception
      D "Conn close because of error #{exception}"
      @socket.close unless @socket.closed? # This is the line that raises the 
error
      raise exception
    end

Fix:
Change line:
@socket.close unless @socket.closed?
to:
@socket.close unless @socket.nil? || @socket.closed?

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to