我有一个带有以下行的java程序员
service.loadPropertiesForItems(Inbox, new PropertySet(ItemSchema.Subject, ItemSchema.Body));
程序从外部 jar 中调用类和方法。
我想在 python 中编写等效代码,它像我的 java 程序一样调用外部 jar。使用 Jpype 我实现了代码,但在下一行失败了
service.loadPropertiesForItems(inbox, ewsPkg.PropertySet(ewsPkg.ItemSchema.Subject, ewsPkg.ItemSchema.Body))
这里的 PropertySet、ItemSchema 是我从外部 jar 中使用的类。ItemSchema.Subject 和 ewsPkg.ItemSchema.Body 是类类型
运行代码我在上面提到的线上得到以下错误 -
service.loadPropertiesForItems(inbox, ewsPkg.PropertySet(ewsPkg.ItemSchema.Subject, ewsPkg.ItemSchema.Body))
File "C:\Python27\lib\site-packages\jpype\_jclass.py", line 79, in _javaInit
self.__javaobject__ = self.__class__.__javaclass__.newClassInstance(*args)
RuntimeError: No matching overloads found. at src/native/common/jp_method.cpp:121
谢谢