Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: bind argument must be an instance of #<Module:0x483af9f5> #2519

Open
jcoyne opened this issue Jan 26, 2015 · 5 comments
Open

TypeError: bind argument must be an instance of #<Module:0x483af9f5> #2519

jcoyne opened this issue Jan 26, 2015 · 5 comments

Comments

@jcoyne
Copy link

@jcoyne jcoyne commented Jan 26, 2015

Using: jruby 1.7.18 (1.9.3p551) 2015-01-06 625381c on Java HotSpot(TM) 64-Bit Server VM 1.7.0_72-b14 +jit [linux-amd64]

TypeError: bind argument must be an instance of #<Module:0x483af9f5>
             define_method at org/jruby/RubyModule.java:1554
   define_method_attribute at /home/travis/build/projecthydra/active_fedora/lib/active_fedora/attribute_methods/read.rb:54
               module_eval at org/jruby/RubyModule.java:2337
   define_method_attribute at /home/travis/build/projecthydra/active_fedora/lib/active_fedora/attribute_methods/read.rb:53
   define_attribute_method at /home/travis/build/projecthydra/active_fedora/gemfiles/vendor/bundle/jruby/1.9/gems/activemodel-4.2.0/lib/active_model/attribute_methods.rb:292
                      each at org/jruby/RubyArray.java:1613
   define_attribute_method at /home/travis/build/projecthydra/active_fedora/gemfiles/vendor/bundle/jruby/1.9/gems/activemodel-4.2.0/lib/active_model/attribute_methods.rb:285
  define_attribute_methods at /home/travis/build/projecthydra/active_fedora/gemfiles/vendor/bundle/jruby/1.9/gems/activemodel-4.2.0/lib/active_model/attribute_methods.rb:252
                      each at org/jruby/RubyArray.java:1613
  define_attribute_methods at /home/travis/build/projecthydra/active_fedora/gemfiles/vendor/bundle/jruby/1.9/gems/activemodel-4.2.0/lib/active_model/attribute_methods.rb:252
           generate_method at /home/travis/build/projecthydra/active_fedora/lib/active_fedora/attribute_methods.rb:117
               synchronize at org/jruby/ext/thread/Mutex.java:149
            mu_synchronize at /home/travis/.rvm/rubies/jruby-1.7.18-d19/lib/ruby/1.9/mutex_m.rb:62
           generate_method at /home/travis/build/projecthydra/active_fedora/lib/active_fedora/attribute_methods.rb:116
                      File at /home/travis/build/projecthydra/active_fedora/lib/active_fedora/file.rb:9
              ActiveFedora at /home/travis/build/projecthydra/active_fedora/lib/active_fedora/file.rb:4
                    (root) at /home/travis/build/projecthydra/active_fedora/lib/active_fedora/file.rb:1
                    (root) at /home/travis/build/projecthydra/active_fedora/lib/active_fedora/om_datastream.rb:1
              ActiveFedora at 
/home/travis/build/projecthydra/active_fedora/lib/active_fedora/om_datastream.rb:4
                    (root) at /home/travis/build/projecthydra/active_fedora/lib/active_fedora/om_datastream.rb:3
                    (root) at /home/travis/build/projecthydra/active_fedora/spec/samples/hydra-mods_article_datastream.rb:1
                   require at org/jruby/RubyKernel.java:1071
          require_relative at file:/home/travis/.rvm/rubies/jruby-1.7.18-d19/lib/jruby.jar!/jruby/kernel19/kernel.rb:24
                     Hydra at /home/travis/build/projecthydra/active_fedora/spec/samples/hydra-mods_article_datastream.rb:21
                   require at org/jruby/RubyKernel.java:1071
                    (root) at /home/travis/build/projecthydra/active_fedora/spec/samples/hydra-mods_article_datastream.rb:2
                   require at org/jruby/RubyKernel.java:1071
                    (root) at /home/travis/build/projecthydra/active_fedora/spec/samples/models/mods_article.rb:1
                   require at org/jruby/RubyKernel.java:1071
                    (root) at /home/travis/build/projecthydra/active_fedora/spec/samples/models/mods_article.rb:2
                      load at org/jruby/RubyKernel.java:1087
                    (root) at /home/travis/build/projecthydra/active_fedora/spec/samples/samples.rb:1
                      each at org/jruby/RubyArray.java:1613
                    (root) at /home/travis/build/projecthydra/active_fedora/spec/samples/samples.rb:2
                    (root) at /home/travis/build/projecthydra/active_fedora/spec/spec_helper.rb:1
                    (root) at /home/travis/build/projecthydra/active_fedora/spec/spec_helper.rb:30
                    (root) at /home/travis/build/projecthydra/active_fedora/spec/integration/associations_spec.rb:1
                    (root) at /home/travis/build/projecthydra/active_fedora/spec/integration/associations_spec.rb:1
@jcoyne
Copy link
Author

@jcoyne jcoyne commented Jan 26, 2015

Loading

@jcoyne
Copy link
Author

@jcoyne jcoyne commented Jan 26, 2015

Loading

@kares
Copy link
Member

@kares kares commented Feb 2, 2015

the owner of the method you're trying to bind is likely not in the target's hierarchy ... you should verify that the same piece of code works on MRI before assuming this to be a JRuby bug, in which case a simple piece of script code reproducing the behaviour might be handy.

Loading

@grosscol
Copy link

@grosscol grosscol commented Mar 25, 2015

I've just run into this issue as well. Looking around a bit I found a brief gist by @jamesotron https://gist.github.com/jamesotron/10336130 that is a minimal example for producing the error.

I'm going to check that this example is a model for what the active fedora code is doing as well. The rails project in which I encountered this runs on mri 2.2 and does not encounter this error.

Loading

@kares
Copy link
Member

@kares kares commented Mar 25, 2015

1.7 is not "that" 2.x compatible ... "transplantable" methods are a feature in 2.x which JRuby does not (yet) support and if it will it might land on 9K only - since 1.7 is primarily MRI 1.9.3 compatible ...

this should be reported with the gems that they do not support 1.9.3 (e.g. active_fedora declares Ruby >= 1.9.3) ... Rails does a similar work-around for generated methods on "older" Rubies.

Loading

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants