0

CMIS연결 내가 설정 매개 변수를 사용하여 야외에 연결하려고하지만 난 오류가 무엇입니까

org.apache.chemistry.opencmis.commons.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.rsm.common.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) 

는 제발 도와주세요 ..를

감사

+0

사용하는 프레스코의 어떤 버전 얻기 위해 다음과 같은 방법을 사용? 그게 올바른 CMIS 종점 URL이 아닐 수도 있습니다 – Gagravarr

+0

Alfresco의 아주 오래된 버전을 사용하지 않는 한 잘못된 서비스 URL입니다. 위키에는 서비스 URL 목록이 있습니다. https://wiki.alfresco.com/wiki/CMIS#CMIS_Service_URL –

답변

0

시도해 주셔서 감사합니다.

(210)
private static Session getSession(String serverUrl, String username, String password) { 
    SessionFactory sessionFactory = SessionFactoryImpl.newInstance(); 
    Map<String, String> params = new HashMap<String, String>(); 
    params.put(SessionParameter.USER, username); 
    params.put(SessionParameter.PASSWORD, password); 
    params.put(SessionParameter.ATOMPUB_URL, serverUrl); 
    params.put(SessionParameter.BINDING_TYPE, BindingType.ATOMPUB.value()); 
    List<Repository> repos = sessionFactory.getRepositories(params); 
    if (repos.isEmpty()) { 
     throw new RuntimeException("Server has no repositories!"); 
    } 
    return repos.get(0).createSession(); 
} 
+0

메소드에서 인수로 전달 된 serverUrl을 설명하십시오. –

+1

ok serverUrl is serverUrl = "http :///"+ ipAlfresco +"/alfresco/api/-default-/public/cmis/versions/1.0/atom "; 그리고 ipAlfresco는 예를 들어 내 로컬 컴퓨터에서 127.0.0.1:8084 –

+0

당신을 도왔을 희망 –

1

세션을

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, "http://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; 
}