09.05.2014 20:40, claudef@br.ibm.com kirjoitti:
Dear colleagues,

Testing a Java RPC-JSON package under Jython 2.7 beta 1. One of the classes with an empty argument input list, throws and error:

   invoker = JsonRpcInvoker()
TypeError: 'NoneType' object is not callable

The Java equivalent is:  JsonRpcInvoker invoker = new JsonRpcInvoker();
The import of the class seems to work OK.  

sys.path.append(userdir + "/jsonrpc-1.0/jsonrpc-1.0-client.jar")
from org.json.rpc.client import *
        url = "http://localhost:8080/jsonrpc"
        transport = HttpJsonRpcClientTransport(URL(url))
        invoker = JsonRpcInvoker()                # <======= this line is causing the error:
        calc = invoker.get(transport, "calc", Calculator.class)
        result = calc.add(1, 2)
        print "Result = " + str(3)

Any idea what's wrong with the instantiation of this Java class, or how to fix it, or is it related to the dynamic class loader?
Strange that you're not getting a syntax error from this because "class" is a reserved keyword in Python so "Calculator.class" cannot possibly work.
That said, have you checked that JsonRpcInvoker is not actually None (for whatever reason)?

I've also tried with .newInstance() which also throws the same error.  


Claude Falbriard
Certified IT Specialist L2 - Middleware
AMS Hortolândia / SP - Brazil
phone:    +55 13 9 9760 0453
cell:         +55 13 9 8117 3316
e-mail:    claudef@br.ibm.com

Is your legacy SCM system holding you back? Join Perforce May 7 to find out:
&#149; 3 signs your SCM is hindering your productivity
&#149; Requirements for releasing software faster
&#149; Expert tips and advice for migrating your SCM now

Jython-users mailing list