pyjnius icon indicating copy to clipboard operation
pyjnius copied to clipboard

NotImplementedError: The method ('apply', ('Ljava/lang/Object;', ('Ljava/lang/Object;',))) is not implemented

Open paliwalg opened this issue 3 years ago • 0 comments

Facing this error

===== Python/java method missing ====== Python class:<hederaDid.generated.PyFunction object at 0x7fb5258aab40> Java method name:apply Signature: (Ljava/lang/Object;)Ljava/lang/Object;

Traceback (most recent call last): File "jnius/jnius_proxy.pxi", line 50, in jnius.PythonJavaClass.invoke File "jnius/jnius_proxy.pxi", line 74, in jnius.PythonJavaClass._invoke NotImplementedError: The method ('apply', ('Ljava/lang/Object;', ('Ljava/lang/Object;',))) is not implemented

PyFunction class is defined as :

class PyFunction(PythonJavaClass):
    __javainterfaces__ = ['java/util/function/Function']
    def __init__(self, fn):
        self.fn = fn
    @java_method('(Ljava/lang/Object;)Ljava/lang/Object;')
    def apply(self, tx):
        return self.fn(tx)

Can you please advise what's missing here ?

paliwalg avatar Jul 27 '21 05:07 paliwalg