gpt4 book ai didi

java - 尝试使用 CMIS 从 Alfresco 5.0 存储库获取FolderRoot 时出现 "Unkown repository"错误

转载 作者:行者123 更新时间:2023-12-01 18:42:58 26 4
gpt4 key购买 nike

我安装了新的 alfresco 社区版本 5.0.a。我正在尝试使用 java 连接器服务来上传/下载可在 4.2.c 露天安装中正常工作的文件。

此连接器应用程序使用chemistry-opencmis-client-api-0.8.0。

使用连接器上传文件时,我打开连接,获取存储库,并且还可以正确获取存储库根文件夹 ID:

SessionFactory sessionFactory = SessionFactoryImpl.newInstance();
Map<String, String> parameter = new HashMap<String, String>();

parameter.put(SessionParameter.BINDING_TYPE, BindingType.ATOMPUB.value());
parameter.put(SessionParameter.ATOMPUB_URL , url );
parameter.put(SessionParameter.USER , user);
parameter.put(SessionParameter.PASSWORD , pass);

if (repository_id != null)
parameter.put(SessionParameter.REPOSITORY_ID, repository_id);

List<Repository> repos = sessionFactory.getRepositories(parameter);
Repository repo = repos.get(0);
log.debug("REPO ID: " + repo.getId());
log.debug("REPO ROOT FOLDER ID: " + repo.getRootFolderId());

然后我创建 session :

Session session = repo.createSession();

但是当我想获取根文件夹对象时:

Folder folder = session.getRootFolder();

我收到“CmisObjectNotFoundException:未知存储库”错误:

org.apache.chemistry.opencmis.commons.exceptions.CmisObjectNotFoundException: Unknown repository! at org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.getObjectInternal(AbstractAtomPubService.java:768) at org.apache.chemistry.opencmis.client.bindings.spi.atompub.ObjectServiceImpl.getObject(ObjectServiceImpl.java:516) at org.apache.chemistry.opencmis.client.runtime.SessionImpl.getObject(SessionImpl.java:403) at org.apache.chemistry.opencmis.client.runtime.SessionImpl.getObject(SessionImpl.java:377) at org.apache.chemistry.opencmis.client.runtime.SessionImpl.getRootFolder(SessionImpl.java:482) at org.apache.chemistry.opencmis.client.runtime.SessionImpl.getRootFolder(SessionImpl.java:476) at com.test.ecm.EcmConnector.open(EcmConnector.java:62) at com.test.ecm.WebServiceController.post(WebServiceController.java:99) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:213) at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:126) at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:96) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:617) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:578) at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:80) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:923) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:852) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882) at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:789) at javax.servlet.http.HttpServlet.service(HttpServlet.java:751) at javax.servlet.http.HttpServlet.service(HttpServlet.java:844) at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:280) at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:254) at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:136) at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:341) at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:238) at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3363) at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3333) at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321) at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120) at weblogic.servlet.provider.WlsSubjectHandle.run(WlsSubjectHandle.java:57) at weblogic.servlet.internal.WebAppServletContext.doSecuredExecute(WebAppServletContext.java:2220) at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2146) at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2124) at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1564) at weblogic.servlet.provider.ContainerSupportProviderImpl$WlsRequestExecutor.run(ContainerSupportProviderImpl.java:254) at weblogic.work.ExecuteThread.execute(ExecuteThread.java:295) at weblogic.work.ExecuteThread.run(ExecuteThread.java:254)

导致此错误的原因是什么?

最佳答案

您使用的服务 URL 不正确。根据documentation ,CMIS 1.0 和 ATOM 绑定(bind)的 URL 为:

https://localhost:8080/alfresco/api/-default-/public/cmis/versions/1.0/atom

关于java - 尝试使用 CMIS 从 Alfresco 5.0 存储库获取FolderRoot 时出现 "Unkown repository"错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59886106/

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