AnsweredAssumed Answered

Error connecting to Alfresco CMIS: Unexpected document! Received: HTML document

Question asked by victorba on Dec 5, 2014
Latest reply on Dec 6, 2014 by victorba
Hi,

I'm trying to connect to Alfresco Community 4.2.0 hosted in a Linux 64 bits server (java 1.7.0_7, encoding UTF-8) through CMIS using this properties:


Map<String, String> parameter = new HashMap<String, String>();
parameter.put(SessionParameter.USER, "USR");
parameter.put(SessionParameter.PASSWORD, "PWD");
parameter.put(SessionParameter.ATOMPUB_URL, "http://xxx:8080/alfresco/api/-default-/public/cmis/versions/1.1/atom");
parameter.put(SessionParameter.BINDING_TYPE, BindingType.ATOMPUB.value());
parameter.put(SessionParameter.OBJECT_FACTORY_CLASS, "org.alfresco.cmis.client.impl.AlfrescoObjectFactoryImpl");

SessionFactory sessionFactory = SessionFactoryImpl.newInstance();

List<Repository> repositories = sessionFactory.getRepositories(parameter);
if (repositories != null && !repositories.isEmpty()) {
   repo = repositories.get(0);
}

org.apache.chemistry.opencmis.client.api.Session session = repo.createSession();


and I'm getting this error:


org.apache.chemistry.opencmis.commons.exceptions.CmisConnectionException: Unexpected document! Received: HTML document
   at org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.parse(AbstractAtomPubService.java:596)
   at org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.getRepositoriesInternal(AbstractAtomPubService.java:777)
   at org.apache.chemistry.opencmis.client.bindings.spi.atompub.RepositoryServiceImpl.getRepositoryInfos(RepositoryServiceImpl.java:65)
   at org.apache.chemistry.opencmis.client.bindings.impl.RepositoryServiceImpl.getRepositoryInfos(RepositoryServiceImpl.java:85)
   at org.apache.chemistry.opencmis.client.runtime.SessionFactoryImpl.getRepositories(SessionFactoryImpl.java:109)
   at org.apache.chemistry.opencmis.client.runtime.SessionFactoryImpl.getRepositories(SessionFactoryImpl.java:96)

If you try the old URL for connecting to Alfresco CMIS (/alfresco/cmisatom) you can see that the result is a xml, but if you try the new URL the result is a html page. What do I have to do to connect with the new URL and now getting this error? Is something that I have missed?

Thanks!

Outcomes