JRuby with Rails 2.2.2 unable to instantiate a java class
---------------------------------------------------------

                 Key: JRUBY-3233
                 URL: http://jira.codehaus.org/browse/JRUBY-3233
             Project: JRuby
          Issue Type: Bug
          Components: Core Classes/Modules
    Affects Versions: JRuby 1.1.5, JRuby 1.1.4
         Environment: Rails 2.2.2 Application
            Reporter: Karthik Krishnan
         Attachments: jruby_bug.zip

I did the following in Rails 2.2.2 + Jruby 1.1.4 or 1.1.5 or 1.1.6RC1

import java.util.Properties
p = Properties.new

Following Error occurs
NameError: uninitialized constant Properties
  from 
/home/msuser1/workspace/ebanking_22/ops/vendor/rails/activesupport/lib/active_support/dependencies.rb:445:in
 `load_missing_constant'
  from 
/home/msuser1/workspace/ebanking_22/ops/vendor/rails/activesupport/lib/active_support/dependencies.rb:77:in
 `const_missing_with_dependencies'
  from 
/home/msuser1/workspace/ebanking_22/ops/vendor/rails/activesupport/lib/active_support/dependencies.rb:89:in
 `const_missing'
  from 
/home/msuser1/workspace/ebanking_22/ops/vendor/rails/railties/lib/rails_generator/lookup.rb:15:in
 `lookup_missing_generator'
  from (irb):3
  from /home/msuser1/jruby-1.1.5/lib/ruby/1.8/irb.rb:150:in `eval_input'
  from /home/msuser1/jruby-1.1.5/lib/ruby/1.8/irb.rb:259:in `signal_status'
  from /home/msuser1/jruby-1.1.5/lib/ruby/1.8/irb.rb:147:in `eval_input'
  from /home/msuser1/jruby-1.1.5/lib/ruby/1.8/irb.rb:146:in `eval_input'
  from /home/msuser1/jruby-1.1.5/lib/ruby/1.8/irb.rb:70:in `start'
  from /home/msuser1/jruby-1.1.5/lib/ruby/1.8/irb.rb:69:in `catch'
  from /home/msuser1/jruby-1.1.5/lib/ruby/1.8/irb.rb:69:in `start'
  from /home/msuser1/jruby-1.1.5/bin/jirb:19

However when I use
p = java.util.Properties.new, it works fine.

PLEASE NOTE : There is no issue when running the above code in Standalone 
Jruby.  This issue happens ONLY when using with Rails 2.2.  No Issues with 
Rails 2.1

I have attached a sample rails 2.2 application.  Unzip the zip file and run the 
server as following
jruby script/server

Please ensure Rails 2.2.2 gem is installed in the machine before running this 
application.

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