Message12192

Author mohamad.mahajna
Recipients jeff.allen, mohamad.mahajna
Date 2018-12-02.11:01:10
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1543748471.19.0.788709270274.issue2717@psf.upfronthosting.co.za>
In-reply-to
Content
Also, what version of Jython are you on?
jython-standalone-2.7.1

Python class : 

	#!/router/bin/python

	from trexImp import TrexClient
	class testAdd(TrexClient):
	    def func1 (self,**kwargs):
	        print(kwargs)

Java code : 

Interface : 

	import java.util.Map;
	public interface TrexClient{
	    public void func1(Map<String,String> kwargs);
	}

Class :
	
	import org.python.core.*;
	import org.python.util.PythonInterpreter;

	import java.util.HashMap;
	import java.util.Map;


	public class TrexClientFactory {
	    public TrexClientFactory() {
	        PythonInterpreter interpreter = new PythonInterpreter();
	        interpreter.exec("import sys");
	        interpreter.exec("sys.path.append('/Users/mohamad.mahajna/IdeaProjects/new_stepsNG/aa/src/main/javatrex_stf_lib1')");
	        interpreter.exec("from testAdd import *");
	        PyObject trexClientClass = interpreter.get("testAdd");
	        PyObject buildingObject = trexClientClass.__call__();
	        TrexClient x = (TrexClient) buildingObject.__tojava__(TrexClient.class);
	        Map<String,String> kwargs = new HashMap<>();
	        kwargs.put("cfg","abcf");
	        x.func1(kwargs);
	    }

	}

	Exception in thread "main" TypeError: func1() takes exactly 1 argument (2 given)
History
Date User Action Args
2018-12-02 11:01:11mohamad.mahajnasetmessageid: <1543748471.19.0.788709270274.issue2717@psf.upfronthosting.co.za>
2018-12-02 11:01:11mohamad.mahajnasetrecipients: + mohamad.mahajna, jeff.allen
2018-12-02 11:01:11mohamad.mahajnalinkissue2717 messages
2018-12-02 11:01:10mohamad.mahajnacreate