cancel
Showing results for 
Search instead for 
Did you mean: 

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

victorba
Champ in-the-making
Champ in-the-making
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!

2 REPLIES 2

afaust
Legendary Innovator
Legendary Innovator
Hello,

which specific version of Community are you using? Please be aware that CMIS 1.1 was first added for the browser binding only and AtomPub binding for CMIS 1.1 was added in subsequent releases. I actually have not checked if the latest 4.2 Community contains AtomPub for 1.1 or if it is only part of Enterprise 4.2.

Regards
Axel

victorba
Champ in-the-making
Champ in-the-making
Hi Axel, thanks for the reply.

I'm using the Alfresco Community 4.2.c version.