与 alfresco cmis 的连接

编程入门 行业动态 更新时间:2024-10-24 10:17:20
本文介绍了与 alfresco cmis 的连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在尝试使用配置参数连接 alfresco,但出现错误:

I am trying to connect alfresco using config parameters but i am getting error:

Config: sessionParameters.put(SessionParameter.USER, "admin"); sessionParameters.put(SessionParameter.PASSWORD, "admin"); sessionParameters.put(SessionParameter.ATOMPUB_URL, "localhost:8080/alfresco/service/cmis"); sessionParameters.put(SessionParameter.BINDING_TYPE, BindingType.ATOMPUB.value()); sessionParameters.put(SessionParameter.REPOSITORY_ID, "CIPBASE"); sessionParameters.put(SessionParameter.AUTH_HTTP_BASIC, "true" ); sessionParameters.put(SessionParameter.COOKIES, "true" );

错误是:

org.apache.chemistry.opencmismons.exceptions.CmisObjectNotFoundException: Not Found at org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.convertStatusCode(AbstractAtomPubService.java:499) at org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.read(AbstractAtomPubService.java:701) at org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.getRepositoriesInternal(AbstractAtomPubService.java:873) at org.apache.chemistry.opencmis.client.bindings.spi.atompub.RepositoryServiceImpl.getRepositoryInfos(RepositoryServiceImpl.java:66) at org.apache.chemistry.opencmis.client.bindings.impl.RepositoryServiceImpl.getRepositoryInfos(RepositoryServiceImpl.java:92) at org.apache.chemistry.opencmis.client.runtime.SessionFactoryImpl.getRepositories(SessionFactoryImpl.java:137) at org.apache.chemistry.opencmis.client.runtime.SessionFactoryImpl.getRepositories(SessionFactoryImpl.java:114) at com.bvonesource.rsmmon.AlfrescoConnection.AlfrescoDument(AlfrescoConnection.java:71) at com.bvonesource.rsm.mgtbean.AdminManagement.MatrixMgtView.callAlfresco(MatrixMgtView.java:208) at com.bvonesource.rsm.mgtbean.AdminManagement.MatrixMgtView$$FastClassByCGLIB$$9e86b32e.invoke() at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149) at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:692) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150) at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:80) at com.bvonesource.foundation.aspect.TracingAspect.invoke(TracingAspect.java:81) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:45) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37) at java.lang.reflect.Method.invoke(Method.java:599) at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:622)

请帮忙..

谢谢

推荐答案

使用以下方法获取session

Use the following method to get session

public Session getSession() { if (session == null) { logger.info("Not connected, creating new connection"); // default factory implementation SessionFactory factory = SessionFactoryImpl.newInstance(); 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, "localhost:8080/alfresco/api/-default-/public/cmis/versions/1.0/atom"); parameter.put(SessionParameter.BINDING_TYPE, BindingType.ATOMPUB.value()); List<Repository> repositories = factory.getRepositories(parameter); if (repositories != null && repositories.size() > 0) { logger.info("Found (" + repositories.size() + ") Alfresco repositories"); this.session = repositories.get(0).createSession(); } else { throw new CmisConnectionException("Could not connect to the Alfresco Server," + " no repository found!"); } } return this.session; }

更多推荐

与 alfresco cmis 的连接

本文发布于:2023-11-28 09:34:22,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1641868.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:alfresco   cmis

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!