Jython Mule ArrayList序列化

时间:2014-06-08 20:39:25

标签: python mule jython

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

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

0 个答案:

没有答案