Hi all,

Apologies if I'm being too stupid to live, but I'm having problems calling Java methods from within Jython.

Specifically I have a method that takes a string one of its parameters.  I can call this fined from python if I pass in a string literal:

        x.myMethod(y, "a string")

But, if I pass in a python object:

Then I have defined then I get "TypeError: myMethod(): 2nd arg can't be coerced to String".

Z is a very simple wrapper class that wraps a string.  (In my real code it does more then this, but for this example all it does is wrap a string.)

So all of the following work fine with Z:

But the x.myMethod(y, z) does not work, and does not call z.__coerce__() either.

Any help much appreciated!

Thanks in advance,
Alex.