Stackoverflow when calling code from java with wrong parameters
---------------------------------------------------------------

                 Key: JRUBY-4788
                 URL: http://jira.codehaus.org/browse/JRUBY-4788
             Project: JRuby
          Issue Type: Bug
          Components: Application Error, Java Integration
    Affects Versions: JRuby 1.4
         Environment: OS X 10.6
Java 1.6 
JRuby 1.5.0RC3 (tested on 1.4.0 as well)
            Reporter: Reto Schüttel


When calling ruby code from java I get strange stack overflow errors when the 
arguments dont match. I was able to create an example of that problem, but I 
got bigger than I hoped.

What it does is:
 1. in ruby start a background thread (implemented java)
 2. define and instantiate a 'factory' in ruby. The factory extends a abstract 
java factory
 3. hand over the factory to the java background class which uses it to create 
a 'job' object
 4. the job is implemented in ruby, but uses an abstract java job class as a 
base class
 5. the background thread now executes a method doJob(DbSesssion) on the 'ruby' 
job object. 

=> at this point a simple error should occur because the signature of the ruby 
method doesn't match the abstract method. But instead jruby creates a huge 
stackoverflow.

You can find a full working example on github:
  http://github.com/retoo/jruby-invocation-problem

the full stacktrace is on: 
  http://gist.github.com/398349

I'm sure the example could be further simplified, but I don't have much more 
time for that right now.


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