AnsweredAssumed Answered

Issue with Repository connection using Apache Chemistry APIs

Question asked by mandarj on Aug 2, 2012
Latest reply on Aug 4, 2012 by mandarj

I am trying use Apache Chemistry client APIs (0.3.0 also tried 0.7.0) to connect to repository through CMIS. I tried with below code but I am not able to establish a connection to repository. I am not sure why its not creating a session. Can somebody help me in this?

The Repository I'm trying to connect is: Alfresco 3.4.1 enterprise

   try {
      SessionFactory factory = SessionFactoryImpl.newInstance();
      Map<String, String> parameter = new HashMap<String, String>();
      parameter.put(SessionParameter.USER, "{username}");
      parameter.put(SessionParameter.PASSWORD, "{password}");
      parameter.put(SessionParameter.ATOMPUB_URL, "http://hostname:8080/alfresco/cmisatom");
      parameter.put(SessionParameter.BINDING_TYPE, BindingType.ATOMPUB.value());
      parameter.put(SessionParameter.OBJECT_FACTORY_CLASS, "org.alfresco.cmis.client.impl.AlfrescoObjectFactoryImpl");
      List<Repository> repositories = factory.getRepositories(parameter);
      Session session = repositories.get(0).createSession();
      log.debug("Connected to repository:" + repositories.get(0).getId());
      Folder root = session.getRootFolder();
   catch(CmisBaseException Excep) {
      log.debug("Error: " + Excep.getErrorContent());

It doesn't throw any exception. So, I added a logging steps as above and it looks like it gets stuck at
List<Repository> repositories = factory.getRepositories(parameter);

The logger says:

   Error: null

Can you help me to solve this issue?