AnsweredAssumed Answered

problem in connecting Public Alfresco CMIS Server

Question asked by raghu on Jun 18, 2012
Latest reply on Sep 3, 2015 by n3k
Hi I'm new to Alfresco, I'm trying to connect to alfresco public server via my java code.Here is the code

 Map<String, String> parameter = new HashMap<String, String>();
       parameter.put(SessionParameter.USER, "admin");
       parameter.put(SessionParameter.PASSWORD,"admin");
      
       //specify connection settings
       parameter.put(SessionParameter.ATOMPUB_URL, "http://cmis.alfresco.com/");
        parameter.put(SessionParameter.BINDING_TYPE, BindingType.ATOMPUB.value());
       
        //set alfresco object factory
        parameter.put(SessionParameter.OBJECT_FACTORY_CLASS, "org.alfresco.cmis.client.impl.AlfrescoObjectFactoryImpl");
       
       
        //create a session
        SessionFactory factory = SessionFactoryImpl.newInstance();
           List<Repository> repositories = factory.getRepositories(parameter);
           for(Repository r: repositories) {
               System.out.println("Id: " + r.getId());
               System.out.println("Name: " + r.getName());
               System.out.println("Description: " + r.getDescription());
           }
           System.out.println();
           Session session = repositories.get(0).createSession();


But I'm getting the following exception

Exception in thread "main" org.apache.chemistry.opencmis.commons.exceptions.CmisConnectionException: Cannot access http://cmis.alfresco.com/: Connection refused: connect

Can someone tell me what is the mistake I'm doing??

Regards,
Raghu

Outcomes