In the past, there used to be some comments on this page about problems in Jything that prevented Pyro to work with it at all, but a lot has been changed since then (Jython has been updated a lot, Pyro and Python itself have seen updates too). I invite you to post about your experiences with using Pyro in Jython below (or on the mailing list as usual). I will try to organise this page now and then to reflect the current known status of using Pyro in Jython.
For starters: Setting it up to use Pyro in Jython:
$ ./jython
Jython 2.5.0 (Release_2_5_0:6476, Jun 16 2009, 13:33:26)
[Java HotSpot(TM) Client VM ("Apple Computer, Inc.")] on java1.5.0_19
Type "help", "copyright", "credits" or "license" for more information.
>>> import Pyro.util
>>> Pyro.util.getGUID()
u'94ba3ca995633592-3220dfbe-123240741e8-8000'
>>>Note: you need Jython 2.5.x, and Pyro 3.8 or newer. Older versions are not supported.
See below.
When using Pyro's timeout feature (setTimeout() call) you trigger unreliable behavior in Jython. So this feature may not be used from Jython code. It will throw a RuntimeException.
The exact problem is that enabling timeouts triggers the use of select(), and that is at this time not yet very stable in Jython. You will get the select() errors mentioned in the following section. must provide some sample code and stacktrace to be able to debug
Sometimes you get crashes like this:
File "E:\jython\Lib\select.py", line 59, in __init__
self.selector = java.nio.channels.Selector.open()
java.io.IOException: java.io.IOException: Unable to establish loopback connection
It seems there is a problem with using select() in jython in threads and/or on client sockets. I have made an issue in Jython's bug tracker about this: issue 1291
In any case, Pyro 3.9 contains a fix in the socket code that removes the select() call that caused these issues. Hopefully the problem gets fixed in Jython itself as well but use Pyro 3.9 if you need to get it working without error now or on older jython versions.
Currently a Pyro server running with Jython on Mac OS X will not work correctly because it will cause connection reset errors. Pyro clients are fine. Also, the error doesn't occur on Windows. I don't yet know what is causing this but I'll try to fix it.
There seem to be some strange problems using the poll function from the select module in Jython. Once the first connection has been made, the server socket will forever trigger the poll function even if there's no new connection available. The accept() call that is done will fail. This problem does not occur on Mac OS X. (and Windows uses select). Pyro 3 doesn't contain this yet but it occurs in the Pyro 4 code that I'm developing.
It seems that sock.recvfrom() always returns (None,-1) as address, when you're using timeouts. So Pyro won't enable a timeout setting on the broadcast server that's part of the name server, when running on Jython.