cancel
Showing results for 
Search instead for 
Did you mean: 

CmisStorageException on checkin

timwebster9
Champ in-the-making
Champ in-the-making
Hi,

I am trying to programmatically add and checkout/checkin documents against Alfresco 4.2f using Apache Chemistry v11.0 (atompub binding).  Frequently I get the following exception from the server while performing a checkin:


org.apache.chemistry.opencmis.commons.exceptions.CmisStorageException: Expected 654502 bytes but retrieved 0 bytes!
   at org.alfresco.opencmis.AlfrescoCmisServiceImpl.copyToTempFile(AlfrescoCmisServiceImpl.java:2812)
   at org.alfresco.opencmis.AlfrescoCmisServiceImpl.checkIn(AlfrescoCmisServiceImpl.java:2029)


If the checkin fails the document remains checkout out, so I then try to delete the document like so (the document here is the object returned from the original createDocument() call):


            if (document.isVersionSeriesCheckedOut()) {
                LOG.info("Cancelling checkout of document with id {}.", document.getId());
                document.cancelCheckOut();
            }

            document.delete();


However, the check to see if it's checked out returns false, and it tries to delete it anyway, resulting in another exception:

org.apache.chemistry.opencmis.commons.exceptions.CmisConstraintException: Could not delete/cancel checkout on the original checked out document

Am I doing anything obviously wrong?


Thanks,
12 REPLIES 12

aowian
Confirmed Champ
Confirmed Champ

I had a similar problem on a clustered Alfresco with 5 nodes.  It is due to a cluster caching bug.  We had to tether our client to a single instance of Alfresco.  Since this is not optimal, we have introduced some retry logic similar to the RetryingTransactionHandler, and we are going to test if we can now remove the tethering.
We tested, and we still need the tethering even though our retry logic retries up to 10 times per transaction with a wait of 1 second in between.

sachinsurya
Champ in-the-making
Champ in-the-making

Hello All,

We are getting "Expected 250536 bytes but retrieved 0 bytes!" in everyday file upload into Alfresco and If we re-run same process again then we are not getting any exception. We couldn't see a pattern when and why it is happening.

I read above answers in the thread but I am looking for how to re-produce the error and find the solution.

We are using below libraries.

org.alfresco.cmis.client = 1.0

org.apache.chemistry.opencmis = 0.13.0

Please advise.

Thanks,

Sachin

Read the kayne zhang answer.