Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/300.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python Jython Mule ArrayList序列化_Python_Mule_Jython - Fatal编程技术网

Python Jython Mule ArrayList序列化

Python Jython Mule ArrayList序列化,python,mule,jython,Python,Mule,Jython,我使用Python组件返回employee对象的数组列表 我收到以下错误消息。我能够从数据库中得到结果,问题似乎在员工数组列表序列化中。任何帮助都将不胜感激 Infinite recursion (StackOverflowError) (through reference chain: org.python.core.PyType["base"]->org.python.core.PyNone["type"]-> Infinite recursion (StackOverflowError)

我使用Python组件返回employee对象的数组列表 我收到以下错误消息。我能够从数据库中得到结果,问题似乎在员工数组列表序列化中。任何帮助都将不胜感激

Infinite recursion (StackOverflowError) (through reference chain: org.python.core.PyType["base"]->org.python.core.PyNone["type"]-> Infinite recursion (StackOverflowError) (through reference chain: org.python.core.PyType["base"]->org.python.core.PyNone["type"]->org.python.core.PyType["base"]->org.python.core.PyType["base"]->org.python.core.PyType["base"]->org.python.core.PyNone[...******************************************************************************** Root Exception stack trace: java.lang.StackOverflowError
OOC为什么要使用Python脚本连接数据库,而不是在Mule级别进行连接?在代码中隐藏Mule在配置级别所能做的事情通常是一种不好的做法。David只是一个如何使用Python组件返回集合的实验。感谢精度:)
employees = ArrayList()
class Employee:
    def __init__(self, empid, username):
        self.empid = empid
        self.username = username



Class.forName("oracle.jdbc.driver.OracleDriver");
connection = DriverManager.getConnection("", "", "")
statement = connection.createStatement()
resultSet = statement.executeQuery("select * from xyz" + " where USER_EMPLOYEE_ID = '" + payload + "'");
while resultSet.next():
    print "%s (%s)" % (resultSet.getString(1), resultSet.getString(2))
    emp = Employee(resultSet.getString(1), resultSet.getString(2))
    System.out.println(" Employee Details " + emp.empid)
    employees.add(emp)
print type(employees)   
result = employees