Search code examples
javaodooxml-rpcodoo-8

Exception: Method not found: execute_kw


I am calling create method of OpenERP through XMLRPC by:

Object[] valuesAllOL = new Object[]{ record };
Object[] all = new Object[]{TINY_DB, uid, PASSWORD, tableName, CREATE_OP, valuesAllOL};

Integer id = (Integer) xmlrpcClient.execute(COMMON_METHOD, all);

Where record is a hashmap.

And:

COMMON_METHOD = "execute_kw";
CREATE_OP = "create";

I've got the following error:

org.apache.xmlrpc.XmlRpcException: Traceback (most recent call last):
  File "/opt/odoo/openerp/service/wsgi_server.py", line 75, in xmlrpc_return
    result = openerp.http.dispatch_rpc(service, method, params)
  File "/opt/odoo/openerp/http.py", line 114, in dispatch_rpc
    result = dispatch(method, params)
  File "/opt/odoo/openerp/service/common.py", line 23, in dispatch
    raise Exception("Method not found: %s" % method)
Exception: Method not found: execute_kw

Any help would be appreciated


Solution

    1. check the URL of the xmlrpc endpoint. Are you using http://servername:port/xmlrpc/2/object

    2. check the server logs, there could be some important information there

    3. check that you can send an http query from the server running the java code to the server running odoo with curl or wget on http://servername:port/xmlrpc/2/object to make sure that there are no proxy/firewall issue