Unstable behavior with ARes in Rails 2.0 PRE1
---------------------------------------------

                 Key: JRUBY-1404
                 URL: http://jira.codehaus.org/browse/JRUBY-1404
             Project: JRuby
          Issue Type: Bug
         Environment: Mac OS X 10.5 9A559
java version "1.6.0_01-dp"
Java(TM) SE Runtime Environment (build 1.6.0_01-dp-b06-77)
Java HotSpot(TM) 64-Bit Server VM (build 1.6.0_01-35-release, mixed mode)
            Reporter: Changshin Lee
            Assignee: Thomas E Enebo


I tested JRuby trunk on Rails 2.0 PRE1 with an JRoR application which uses 
ActiveResource, and found some weird behavior. 

To reproduce the behavior,

1. Download the application from 
http://ias.springnote.com/pages/512602/attachments/226453 (or open 
http://ias.springnote.com/pages/512602.xhtml and click rails2_ares_test.zip 
link)

2. Unzip it and run "jruby script/server".

3. Access http://localhost:3000/ with your browser and you can see a list. This 
causes "Page" resource to do "find :all", which works fine.

4. Meanwhile, access http://localhost:3000/pages/4434 and you might see

Home

or the following error message:
---
 NoMethodError in PagesController#show

You have a nil object when you didn't expect it!
The error occurred while evaluating nil.attributes

RAILS_ROOT: /Volumes/FLASHBACK/workspace/rails2_ares_test
Application Trace | Framework Trace | Full Trace

vendor/rails/activesupport/lib/active_support/vendor/xml_simple.rb:708:in 
`get_attributes'
vendor/rails/activesupport/lib/active_support/vendor/xml_simple.rb:462:in 
`collapse'
vendor/rails/activesupport/lib/active_support/core_ext/hash/conversions.rb:30:in
 `xml_in_string'
vendor/rails/activesupport/lib/active_support/core_ext/hash/conversions.rb:40:in
 `xml_in_string'
vendor/rails/activesupport/lib/active_support/core_ext/hash/conversions.rb:159:in
 `from_xml'
vendor/rails/activeresource/lib/active_resource/formats/xml_format.rb:19:in 
`decode'
vendor/rails/activeresource/lib/active_resource/connection.rb:74:in `get'
vendor/rails/activeresource/lib/active_resource/base.rb:461:in `find_single'
vendor/rails/activeresource/lib/active_resource/base.rb:388:in `find'
app/controllers/pages_controller.rb:3:in `show'
...
---

If you see either "Home" or the error message, please repeat refreshing your 
browser with F5 or CTRL(Command)+R, then you can see the other result. In case 
the error occurs, connection.rb shows that status 200 and length 0 in its info 
logging.

I tested this application with MRI and it worked well with both 
http://localhost:3000/pages and http://localhost:3000/pages/4434

What I guess about this discrepancy is that HTTPS connection in JRuby may have 
some problem.

-- 
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