gpt4 book ai didi

java - Factory.Folder.fetchInstance 方法不适用于路径

转载 作者:行者123 更新时间:2023-12-02 13:15:34 24 4
gpt4 key购买 nike

在我当前的项目中,使用 Filenet P8 Content Platform Engine 5.2.1 与 WebSphere 8.5.5.3、Eclipse Mars 4.5.2 和 Apache Maven 3.3.1

我使用如下代码获取连接对象:

Connection connection = Factory.Connection.getConnection(url);
Subject subject = UserContext.createSubject(connection, username, password, null);
UserContext context = UserContext.get();
context.pushSubject(subject);

其中用户名是p8admin,对象存储如下:

Domain domain = Factory.Domain.fetchInstance((com.filenet.api.core.Connection) conn, null, null);                   
objectStore = Factory.ObjectStore.fetchInstance(domain, objectStoreName, null);

当使用 fetchInstance 方法从其路径中获取文件夹时,代码如下:

String folderPath = "/Lotto L02‎/Amministrazione AMM_000072_00001";
PropertyFilter pf = new PropertyFilter();
pf.addIncludeProperty(new FilterElement(null, null, null, PropertyNames.PERMISSIONS, null));
Folder folder = Factory.Folder.fetchInstance(objectStore, folderPath, pf);

如果我使用folderID一切正常,而使用folderPath则不起作用,得到:

com.filenet.api.exception.EngineRuntimeException: FNRCE0051E: E_OBJECT_NOT_FOUND: The requested item was not found. Folder /Lotto L02‎/Amministrazione AMM_000072_00001 not found. errorStack={ at com.filenet.engine.retrieve.FolderCache.getFolderId(FolderCache.java:515) at com.filenet.engine.retrieve.IndependentClassRetriever.getObjectIdForPath(IndependentClassRetriever.java:936) at com.filenet.engine.retrieve.IndependentClassRetriever.getObjectByPath(IndependentClassRetriever.java:867) at com.filenet.engine.retrieve.IndependentClassRetriever.getObject(IndependentClassRetriever.java:815) at com.filenet.engine.retrieve.IndependentClassRetriever.getObject(IndependentClassRetriever.java:749) at com.filenet.engine.retrieve.IndependentClassRetriever.getObject(IndependentClassRetriever.java:362) at com.filenet.engine.jca.impl.RequestBrokerImpl.getObjects(RequestBrokerImpl.java:913) at com.filenet.engine.jca.impl.RequestBrokerImpl.getObjects(RequestBrokerImpl.java:816) ...

该文件夹位于对象存储的根目录中,安全性设置如下:

Folder security

我做错了什么?

最佳答案

FileNet 为您提供了一条非常清晰简洁的错误消息:

The requested item was not found. Folder /Lotto L02‎/Amministrazione AMM_000072_00001 not found.

这可能是因为您正在查找错误的域、对象存储,或者您没有读取该文件夹的权限。也许您正在尝试获取尚未保存到对象存储中的文件夹。

无论如何,我没有发现您提供的代码有任何问题;然而,由于可用信息有限,我只能假设从 FileNet 连接的角度来看该文件夹不存在

关于java - Factory.Folder.fetchInstance 方法不适用于路径,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43779091/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com