gpt4 book ai didi

java - org.apache.chemistry.opencmis.commons.exceptions.CmisInvalidArgumentException

转载 作者:行者123 更新时间:2023-12-01 10:24:37 24 4
gpt4 key购买 nike

我使用的露天版本:Community v4.0.0

我有一个露天附件的 ID:

abd73a24-2728-4638-9899-bb2cda9802ed

我想使用 cmis 获取此文件的内容

我尝试使用此代码但没有成功:

String docId="abd73a24-2728-4638-9899-bb2cda9802ed";

Map<String, String> parameter = new HashMap<String, String>();
parameter.put(SessionParameter.USER, "admin");
parameter.put(SessionParameter.PASSWORD, "admin");

parameter.put(SessionParameter.ATOMPUB_URL, "http://192.168.1.120:8080/alfresco/cmisatom");
parameter.put(SessionParameter.BINDING_TYPE, BindingType.ATOMPUB.value());
SessionFactory factory = SessionFactoryImpl.newInstance();

Repository repository = factory.getRepositories(parameter).get(0);

Session session = repository.createSession();

System.out.println("Connected to repository:" + session.getRepositoryInfo().getName());
System.out.println("Repository id:"+session.getRepositoryInfo().getId());

// Get the contents of the file
Document doc = (Document) session.getObject(docId);

这是错误

Connected to repository:Main Repository
Repository id:516c4b81-f9d6-44fc-94b7-7c7f70c79ade
Exception in thread "main" org.apache.chemistry.opencmis.commons.exceptions.CmisInvalidArgumentException: Object id is invalid: abd73a24-2728-4638-9899-bb2cda9802ed
at org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.convertStatusCode(AbstractAtomPubService.java:423)
at org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.read(AbstractAtomPubService.java:554)
at org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.getObjectInternal(AbstractAtomPubService.java:778)
at org.apache.chemistry.opencmis.client.bindings.spi.atompub.ObjectServiceImpl.getObject(ObjectServiceImpl.java:481)
at org.apache.chemistry.opencmis.client.runtime.SessionImpl.getObject(SessionImpl.java:393)
at org.apache.chemistry.opencmis.client.runtime.SessionImpl.getObject(SessionImpl.java:371)

我在我的项目中使用了这个库

enter image description here

使用导航器并使用此网址:

http://192.168.1.120:9080/alfresco/d/d/workspace/SpacesStore/
abd73a24-2728-4638-9899-bb2cda9802ed/test.txt

我可以打开该文件

最佳答案

尝试将存储引用附加到 id(协议(protocol) + 标识符):

workspace://SpacesStore/abd73a24-2728-4638-9899-bb2cda9802ed

关于java - org.apache.chemistry.opencmis.commons.exceptions.CmisInvalidArgumentException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35410385/

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