例外:找不到方法:execute_kw

时间:2016-03-06 21:59:50

标签: java openerp xml-rpc odoo-8

我通过XMLRPC调用OpenERP的create方法:

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);

recordhashmap

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

我遇到以下错误:

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

任何帮助将不胜感激

1 个答案:

答案 0 :(得分:3)

  1. 检查xmlrpc端点的URL。您使用的是http://servername:port/xmlrpc/2/object

  2. 吗?
  3. 检查服务器日志,可能会有一些重要信息

  4. 检查您是否可以从运行java代码的服务器向运行odoo的服务器发送http查询,使用http://servername:port/xmlrpc/2/object上的curl或wget来确保没有代理/防火墙问题