From: SAKURAI Masashi Date: 2005-11-08T23:48:37+09:00 Subject: Re: yajb usage queries... Hi, W.B.Hill wrote: > OK - How can I pass a value *from* java to the ruby implementation of > the abstract class??? If the commented out code is activated it gives: > jbridge.RemoteRuntimeException: class=TypeError message=can't convert > Fixnum into String This error is simply thrown by ruby, not yajb. I could run your code, appending ".to_s", as follows: > puts("---> Param given: " + arg.to_s) > Also, this code seems to suffer from a race. *Sometimes* rtest is > called before jtest has finished! Possibly related, one run can finish > fine, but the next run gives: > > Full thread dump Java HotSpot(TM) Client VM (1.4.2_09-b05 mixed mode): > "Thread-16" prio=1 tid=0x081c4520 nid=0x7cb8 waiting on condition > [4d063000..4d0638b8] > at java.lang.Thread.sleep(Native Method) > at jbridge.BridgeServer$1.run(BridgeServer.java:248) > at java.lang.Thread.run(Unknown Source) > > How can I syncronize properly (I'm guessing this is an issue of the > ruby end of the bridge quitting before the java's done, but I'd prefer > not to have to do a wrapper on the java end of things.) Your guess is correct. When ruby finishes, the ruby side of yajb sends a shutdown message to the java side. Then the java side calls System.exit after the 0.5 second sleep due to waiting for the completion of shutdown message. I think the crush dump was caused by TERM signal during sleeping. I will reconsider the finish scheduling and improve in the next release. > BTW, really like yajb for the integration, the way there's only jars > and ruby, no JNI to mess around with! Yes. I think that yajb is useful for the application deployment under the environment that has no compiler, such as Windows. OTOH, because the performance is also important, I 'm considering writing the JNI driver. Thanks. -- SAKURAI Masashi (family given) m.sakurai@dream.com