Invalid amount of arguments passed to ruby method from java.
------------------------------------------------------------

                 Key: JRUBY-987
                 URL: http://jira.codehaus.org/browse/JRUBY-987
             Project: JRuby
          Issue Type: Bug
          Components: Java Integration
    Affects Versions: JRuby 1.0.0RC2
         Environment: Linux alpha 2.6.17-10-386 #2 Fri Oct 13 18:41:40 UTC 2006 
i686 GNU/Linux

java version "1.5.0_10"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_10-b03)
Java HotSpot(TM) Client VM (build 1.5.0_10-b03, mixed mode, sharing)

            Reporter: Rickard Bäckman


I'm using jruby for implementing java interfaces in the code and from time to 
time I get a "too few arguments (2 of 3)" or similiar.

I tried to convert one of these ruby methods to 

def method(*args)
  raise "Arguments is #{args.size}" unless args.size == 3
  ...
end

and got this:

org.jruby.exceptions.RaiseException
product.rb:38:in `readCategoryPrices': ERROR arguments: 2 (RuntimeError)
        from /jruby/src/builtin/javasupport/proxy/interface.rb:155:in `send'
        from /jruby/src/builtin/javasupport/proxy/interface.rb:155:in 
`__jcreate!'
        from /jruby/src/builtin/javasupport/proxy/interface.rb:138
        ...internal jruby stack elided...
        from org.jruby.runtime.Block.yield(Block.java:220)
        from org.jruby.runtime.Block.call(Block.java:174)
        from org.jruby.RubyProc.call(RubyProc.java:166)
        from org.jruby.RubyProc.call(RubyProc.java:142)
        from org.jruby.javasupport.Java$1.invoke(Java.java:806)
        from $Proxy5.readCategoryPrices(Unknown Source)
        from 
com.pricerunner.yggdrasil.loader.ProductLoader.loadPricesQuick(ProductLoader.java:47)
        from 
com.pricerunner.yggdrasil.system.TestGetProductRequest.loadAll(TestGetProductRequest.java:57)
        from 
com.pricerunner.yggdrasil.system.TestGetProductRequest.setUp(TestGetProductRequest.java:47)
        from 
com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:40)
        from sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        from 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        from 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        from com.intellij.rt.execution.application.AppMain.main(AppMain.java:90)

It doesn't happen every time and the java code utilizes a couple of threads 
which makes calls to the ruby implemented java interfaces. The method is only 
called through java (and always with 3 arguments?). 


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