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
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:
Hi Jeff,
Thanks for the reply.
We don't use a proxy.
Regards,
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.