#1504 ✓resolved
santosh kumar

we use jruby1.6.1 with --1.9 and it fails with undefined method ‘new!’ for Rational:Class

Reported by santosh kumar | April 16th, 2011 @ 03:38 AM

while executing- CrawlStatus.update(:id => "delete row", :end => Time.now)


org.jruby.exceptions.RaiseException: (NoMethodError) undefined method `new' for Rational:Class

    at data_objects.Reader.next!(data_objects/Reader.java:130)
    at DataMapper::Adapters::MysqlAdapter.read(/home/sdf/.rvm/gems/jruby-1.6.0/gems/dm-do-adapter-1.1.0/lib/dm-do-adapter/adapter.rb:153)
    at DataMapper::Adapters::DataObjectsAdapter.with_connection(/home/sdf/.rvm/gems/jruby-1.6.0/gems/dm-do-adapter-1.1.0/lib/dm-do-adapter/adapter.rb:276


    at DataMapper::Adapters::DataObjectsAdapter.read(/home/sdf/.rvm/gems/jruby-1.6.0/gems/dm-do-adapter-1.1.0/lib/dm-do-adapter/adapter.rb:141)
    at DataMapper::Repository.read(/home/sdf/.rvm/gems/jruby-1.6.0/gems/dm-core-1.1.0/lib/dm-core/repository.rb:162)
    at DataMapper::Collection.lazy_load(/home/sdf/.rvm/gems/jruby-1.6.0/gems/dm-core-1.1.0/lib/dm-core/collection.rb:1117)
    at LazyArray.each(/home/sdf/.rvm/gems/jruby-1.6.0/gems/dm-core-1.1.0/lib/dm-core/support/lazy_array.rb:409)
    at DataMapper::Collection.each(/home/sdf/.rvm/gems/jruby-1.6.0/gems/dm-core-1.1.0/lib/dm-core/collection.rb:504)
    at org.jruby.RubyEnumerable.map(org/jruby/RubyEnumerable.java:724)
    at rubyjit.resources_added_5C6D0EE231E44B7310085E60CD75B225B769BB79.resources_added(/home/sdf/.rvm/gems/jruby-1.6.0/gems/dm-core-1.1.0/lib/dm-core/co


    at DataMapper::Collection.replace(/home/sdf/.rvm/gems/jruby-1.6.0/gems/dm-core-1.1.0/lib/dm-core/collection.rb:701)
    at DataMapper::Collection.reload(/home/sdf/.rvm/gems/jruby-1.6.0/gems/dm-core-1.1.0/lib/dm-core/collection.rb:80)
    at DataMapper::Resource.eager_load(/home/sdf/.rvm/gems/jruby-1.6.0/gems/dm-core-1.1.0/lib/dm-core/resource.rb:876)
    at DataMapper::Resource.lazy_load(/home/sdf/.rvm/gems/jruby-1.6.0/gems/dm-core-1.1.0/lib/dm-core/resource.rb:859)
    at org.jruby.RubyBasicObject.__send__(org/jruby/RubyBasicObject.java:1671)
    at DataMapper::Property.lazy_load(/home/sdf/.rvm/gems/jruby-1.6.0/gems/dm-core-1.1.0/lib/dm-core/property.rb:672)
    at DataMapper::Resource::State::Persisted.lazy_load(/home/sdf/.rvm/gems/jruby-1.6.0/gems/dm-core-1.1.0/lib/dm-core/resource/state/persisted.rb:23)
    at DataMapper::Resource::State::Persisted.get(/home/sdf/.rvm/gems/jruby-1.6.0/gems/dm-core-1.1.0/lib/dm-core/resource/state/persisted.rb:8)
    at DataMapper::Resource.attribute_get(/home/sdf/.rvm/gems/jruby-1.6.0/gems/dm-core-1.1.0/lib/dm-core/resource.rb:243)
    at extraction_and_dedup_automation.find_files_to_extract(extraction_and_dedup_automation.rb:33)
    at DataMapper::Collection.each(/home/sdf/.rvm/gems/jruby-1.6.0/gems/dm-core-1.1.0/lib/dm-core/collection.rb:507)
    at DataMapper::Collection.each(/home/sdf/.rvm/gems/jruby-1.6.0/gems/dm-core-1.1.0/lib/dm-core/support/lazy_array.rb:411)
    at org.jruby.RubyArray.each(org/jruby/RubyArray.java:1572)
    at LazyArray.each(/home/sdf/.rvm/gems/jruby-1.6.0/gems/dm-core-1.1.0/lib/dm-core/support/lazy_array.rb:411)
    at DataMapper::Collection.each(/home/sdf/.rvm/gems/jruby-1.6.0/gems/dm-core-1.1.0/lib/dm-core/collection.rb:504)

Comments and changes to this ticket

  • Piotr Solnica (solnic)

    Piotr Solnica (solnic) April 16th, 2011 @ 06:27 AM

    • State changed from “new” to “unconfirmed”

    Many issues with jRuby 1.9 have been fixed in edge. Can you try grabbing dm-core from master and see if it works for you?

  • santosh kumar

    santosh kumar April 18th, 2011 @ 01:30 AM

    thanks Piotr
    it works , after grabbing dm-core from master .

  • santosh kumar

    santosh kumar April 18th, 2011 @ 01:59 AM

    @Piotr , sorry for above update actually i tried with ruby and it worked.

    we updated dm-do-adapter and dm-core yet it doesnt work with jruby

  • Dan Kubb (dkubb)

    Dan Kubb (dkubb) April 20th, 2011 @ 12:15 AM

    • Assigned user set to “Alex Coles”

    @santosh: I think that specific error is fixed in edge DO (data_objects and the do_* database drivers).

    I'm assigning this to Alex (@myabc), since he's working on JRuby improvements to DO. Building the JRuby gems from the repo is a bit of a pain last time I looked, but I think he's gearing up for an RC gem release, which will make it easier to test.

  • Alex Coles

    Alex Coles April 20th, 2011 @ 12:36 AM

    This is fixed on master / edge (as well as encoding issues for 1.9 mode). See commit # 3393b60. A RC is imminent.

    You can build the gem yourself with 'rake compile' from the repo. However, if you're using Bundler, then you'll have to wait for a binary release (or run 'rake compile' and specify DO as a :path dependency). As @dkubb alluded, we are looking at solutions for allowing Bundler to build gems with JRuby/Java-extensions when specified as a :git dependency, but this work won't make the RC unfortunately.

  • Alex Coles

    Alex Coles April 20th, 2011 @ 12:37 AM

    • Tag set to jruby 1.9 do do_jdbc
  • Alex Coles

    Alex Coles April 20th, 2011 @ 12:37 AM

    • Tag changed from jruby 1.9 do do_jdbc to 1.9, do, do_jdbc, jruby
    • State changed from “unconfirmed” to “resolved”

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »