1

我正在 jython 2.7 中开发 IBM FileNet P8 Platform 5.2.1 Content Engine 单元测试应用程序。

# Verify a directory
def testDirectory(self):
    directoryConfigurationList = [] 
    url = self.serverUrl + "?tenantId=" + self.tenantName  
    connection = Factory.Connection.getConnection(url)
    domain = Factory.Domain.fetchInstance(connection, self.tenantName, None)
    if (domain is not None):
        dc_set = domain._DirectoryConfigurations.iterator()
        while dc_set.hasNext():
            dc = dc_set.next()
            print dc._DisplayName

我收到错误消息:

TypeError:共享修改属性的超类型存在 MRO 冲突[attribute=remove, supertypes=[, 'com.filenet.api.collection.DependentObjectList'>], type=CmIndexPartitionConstraintList]

在线 dc_set = domain._DirectoryConfigurations.iterator()我现在不太清楚为什么。对此的任何帮助将不胜感激。以下指向 IBM 5.2.1 知识中心的链接可能会有所帮助:

4

1 回答 1

0

问题不在您的 fileNet 代码中,看起来 Jython 不希望看到同样是 Iterable 的 Map。我认为它具有在每个上安装iter然后发生冲突的逻辑。不幸的是,实现 Map 和 Iterable 的类型并没有错。Jython 应该遵从 Iterable 的iter,但看起来它需要和增强才能做到这一点。

如果你检查DependentObjectList接口规范,你会在超类型接口中看到它的超类型接口是java.util.Collection, EngineCollection, java.lang.Iterable, java.util.List, java.io.Serializable.

我相信自 Jython 2.7b1 以来可能已修复此问题。

更新:
我一直在挖掘我们之前用 Java 开发的代码,我们使用以下逻辑将引擎集合转换为基于列表的集合

public static <T> List<T> convertToList(EngineCollection engineCollection) {
    Iterator<T> engineCollectionIterator = engineCollection.iterator();
    List<T> collection = new ArrayList<T>();
    CollectionUtils.addAll(collection , engineCollectionIterator);
    return collection ;
}
于 2016-07-15T05:59:16.977 回答