none
Apache CMIS - Sharepoint integration -org.apache.chemistry.opencmis.commons.exceptions.CmisInvalidArgumentException: Bad Request

    Question

  • Hi

    scenario: Upload a file in sharepoint using the CMIS APIs.(CMIS is version 1.1)

     I am able to upload a new file ,e.g. demo.txt, file version 1.0 in SharePoint through the CMIS API without any issues.

    when i try to make changes to the same file  and try to upload it as the next version,e.g file version 1.1., i get the following error:

    <org.apache.chemistry.opencmis.commons.exceptions.CmisInvalidArgumentException: Bad Request>

    the checkout of the file happens fine.But i get exception when i am trying to check-in the file.

    Is there a versioning problem with Sharepoint?

    //----------------------------my java code snippet given below:------------------------------------//

                 Document pwc = (Document) cmisSession.getObject(doc.checkOut());// THIS HAPPENS FINE ALRIGHT

                 String filename = doc.getName();
                 String mimetype = "application/octet-stream; charset=UTF-8";

                ContentStream contentStream = cmisSession.getObjectFactory().createContentStream(filename, newData.available(),mimetype, newData);//this will overwrite the existing file with new data

                try {
                    docId = pwc.getId();
                    pwc.checkIn(false, null, contentStream, "minor version"); // THIS IS WHERE I GET EXCEPTION
                } catch (Exception e) {
                    e.printStackTrace();
                    System.out.println("checkin failed, trying to cancel the checkout");
                    pwc.cancelCheckOut();
                    System.out.println("Cancel Checkout the file with minor version");
                }
    //---------------------------------------end java code snippet---------------------//

    can you please advise why this is happening? In all the forums that i have browsed,they say that it is issue with Sharepoint and MS will be probably providing a patch to resolve this issue.

    Please advise.
    Thanks in advance for your reply.

    Regards

    Vinod V Menon


    vendredi 13 juillet 2018 10:08

Toutes les réponses