cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to access HCP document repository

Former Member
0 Kudos

Hi Team,

I am trying to create document repository in HCP while creating session got the below error please suggest what needs to be done

org.apache.chemistry.opencmis.commons.exceptions.CmisConnectionException: Parsing exception! at org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.parse(AbstractAtomPubService.java:529) at org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.getRepositoriesInternal(AbstractAtomPubService.java:717) at org.apache.chemistry.opencmis.client.bindings.spi.atompub.RepositoryServiceImpl.getRepositoryInfo(RepositoryServiceImpl.java:62) at org.apache.chemistry.opencmis.client.bindings.impl.RepositoryServiceImpl.getRepositoryInfo(RepositoryServiceImpl.java:69) at org.apache.chemistry.opencmis.client.runtime.SessionImpl.connect(SessionImpl.java:610) at org.apache.chemistry.opencmis.client.runtime.SessionFactoryImpl.createSession(SessionFactoryImpl.java:90) at org.apache.chemistry.opencmis.client.runtime.SessionFactoryImpl.createSession(SessionFactoryImpl.java:64) at com.acn.rpa.utilities.CmisClient.connect(CmisClient.java:184) at com.acn.rpa.utilities.CmisClient.main(CmisClient.java:45)

, please find the below code which is used

private static Folder connect() {

SessionFactory sessionFactory = SessionFactoryImpl.newInstance();

Map<String, String> parameter = new HashMap<String, String>(); parameter.put(SessionParameter.USER, "userId"); parameter.put(SessionParameter.PASSWORD, "password"); parameter.put(SessionParameter.ATOMPUB_URL, "https://trial.hanatrial.ondemand.com/ProjectName/cmis/json"); parameter.put(SessionParameter.BINDING_TYPE, BindingType.ATOMPUB.value()); parameter.put(SessionParameter.REPOSITORY_ID, "repositoryId"); parameter.put(SessionParameter.AUTHENTICATION_PROVIDER_CLASS, CmisBindingFactory.NTLM_AUTHENTICATION_PROVIDER);

session = sessionFactory.createSession(parameter);

return session.getRootFolder();

}

and I imported below classes for this program

import org.apache.chemistry.opencmis.client.api.CmisObject;

import org.apache.chemistry.opencmis.client.api.Document;

import org.apache.chemistry.opencmis.client.api.Folder;

import org.apache.chemistry.opencmis.client.api.Session;

import org.apache.chemistry.opencmis.client.api.SessionFactory;

import org.apache.chemistry.opencmis.client.bindings.CmisBindingFactory;

import org.apache.chemistry.opencmis.client.runtime.SessionFactoryImpl;

import org.apache.chemistry.opencmis.commons.PropertyIds;

import org.apache.chemistry.opencmis.commons.SessionParameter;

import org.apache.chemistry.opencmis.commons.data.ContentStream;

import org.apache.chemistry.opencmis.commons.enums.BaseTypeId;

import org.apache.chemistry.opencmis.commons.enums.BindingType;

import org.apache.chemistry.opencmis.commons.enums.UnfileObject;

import org.apache.chemistry.opencmis.commons.enums.VersioningState;

import org.apache.chemistry.opencmis.commons.exceptions.CmisObjectNotFoundException; import org.apache.commons.lang3.StringUtils;

Thanks & Regards,

Rajesh V

Accepted Solutions (0)

Answers (1)

Answers (1)

0 Kudos

Hi Rajesh V,

from your code I see that your are using the session parameters for Atompub Binding:

parameter.put(SessionParameter.ATOMPUB_URL, "https://trial.hanatrial.ondemand.com/ProjectName/cmis/json"); parameter.put(SessionParameter.BINDING_TYPE, BindingType.ATOMPUB.value());

But from the URL you are using I see that this is a Browser Binding URL.

So you either should change the URL to the atompub specific or what's the better option use browser binding instead:

parameter.put(SessionParameter.BROWSER_URL, " https://trial.hanatrial.ondemand.com/ProjectName/cmis/json"); parameter.put(SessionParameter.BINDING_TYPE, BindingType.BROWSER.value());

Best regards

Alex