gpt4 book ai didi

java - 获取根文件夹时 Chemistry OpenCmis 出错

转载 作者:行者123 更新时间:2023-11-30 08:41:12 27 4
gpt4 key购买 nike

我正在使用 chemistry opencmis 0.13.0 版连接到 alfresco 存储库。下面是代码片段

    Map<String, String> parameter = new HashMap<String, String>();

// user credentials
parameter.put(SessionParameter.USER, "admin");
parameter.put(SessionParameter.PASSWORD, "admin");

// connection settings
parameter.put(SessionParameter.ATOMPUB_URL, "http://localhost:8080/alfresco/cmisatom");
parameter.put(SessionParameter.BINDING_TYPE, BindingType.ATOMPUB.value());

// set the alfresco object factory
parameter.put(SessionParameter.OBJECT_FACTORY_CLASS, "org.alfresco.cmis.client.impl.AlfrescoObjectFactoryImpl");

// create session
SessionFactory factory = SessionFactoryImpl.newInstance();
Session session = factory.getRepositories(parameter).get(0).createSession();

我可以创建 session ,但是当执行以下操作时

session.getRootFolder();

我遇到以下异常

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". SLF4J: Defaulting to no-operation (NOP) logger implementation SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details. Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/chemistry/opencmis/client/api/TransientCmisObject at org.alfresco.cmis.client.impl.AlfrescoObjectFactoryImpl.convertObject(AlfrescoObjectFactoryImpl.java:297) at org.apache.chemistry.opencmis.client.runtime.SessionImpl.getObject(SessionImpl.java:523) at org.apache.chemistry.opencmis.client.runtime.SessionImpl.getRootFolder(SessionImpl.java:735) at org.apache.chemistry.opencmis.client.runtime.SessionImpl.getRootFolder(SessionImpl.java:729) at cmisops.CMISConnect.main(CMISConnect.java:60) Caused by: java.lang.ClassNotFoundException: org.apache.chemistry.opencmis.client.api.TransientCmisObject at java.net.URLClassLoader.findClass(URLClassLoader.java:381) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ... 5 more

我正在使用 chemistry-opencmis-client-api-0.13.0,chemistry-opencmis-client-bindings-0.13.0,chemistry-opencmis-client-impl-0.13.0,chemistry-opencmis-commons-api- 0.13.0,chemistry-opencmis-commons-impl-0.13.0,alfresco-opencmis-extension-0.3

我使用的是 Alfresco enterprise 5.0 版本。

最佳答案

尝试使用此端点而不是您正在使用的端点:

http://<hostname>:<port>/alfresco/api/-default-/public/cmis/versions/1.1/atom

请引用this page解决露天的任何 CMIS 绑定(bind)问题。


更新: OP solved the issue通过 setting a repository id in his session parameters .

关于java - 获取根文件夹时 Chemistry OpenCmis 出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35217944/

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