06-28-2021 05:56 AM
Hi,
I developed an interface to Alfresco Community Edition using CMIS 1.1 API which worked fine.
Recently our company upgraded the Alfresco Server to version 6.2 (not sure from which version) and now any call on the org.apache.chemistry.opencmis.client.api.Session object throws this error: org.apache.chemistry.opencmis.commons.exceptions.CmisInvalidArgumentException: Bad request
I discussed with our Alfresco administrator and there is no error in alfresco.log when this event happens.
My code is something like:
SessionFactory sessionFactory = SessionFactoryImpl.newInstance();
Map<String, String> parameters = new HashMap<String, String>();
parameters.put(SessionParameter.USER, "<user>");
parameters.put(SessionParameter.PASSWORD, "<pwd>");
// Connection settings.
parameters.put(SessionParameter.BINDING_TYPE, BindingType.ATOMPUB.value());
parameters.put(SessionParameter.ATOMPUB_URL, "https://<ALFRESCO HOST>/alfresco/api/-default-/public/cmis/versions/1.1/atom");
parameters.put(SessionParameter.AUTH_HTTP_BASIC, "true");
parameters.put(SessionParameter.COOKIES, "true");
// Create session.
// Alfresco only provides one repository.
Repository repository = sessionFactory.getRepositories(parameters).get(0);
Session session = repository.createSession();
Folder root = session.getRootFolder(); // throws ....CmisInvalidArgumentException: Bad request
The session object seems to be created, but I get the error mentioned above whichever call I try to execute on the session object (i.e. list or upload).
Thanks
07-06-2021 12:46 PM
Your code works fine for me running 6.2.2 Enterprise Edition via the Alfresco SDK.
If you are going through a proxy, check the CMIS URL Settings in your alfresco-global.properties file. You might need to override your opencmis.server.value if you are going through a proxy.
For example:
07-20-2021 03:43 AM
Hi Jeff,
Thanks for the reply.
We don't use a proxy.
Regards,
Explore our Alfresco products with the links below. Use labels to filter content by product module.