OpenCMIS Woes (MigrationTargetAlfrescoCMIS) - tsgrp/OpenMigrate GitHub Wiki
Create Version Issues
Error creating version 0900000e80001217 on document workspace://SpacesStore/b0e6b0d3-41fd-4f61-8f88-4e222fa69234;1.1: Object not found: workspace://SpacesStore/b0e6b0d3-41fd-4f61-8f88-4e222fa69234;1.2
- that object not found basically just means that SOME error happened on the alfresco side- not necessarly that the object wasnt found
- check alfresco logs see if there’s anything useful
- what version of cmis are you using? turns out we should always be using 1.0 but make sure you’re using the right alfresco object factory
- worst case you can debug within alfresco and see if any properties you need are missing
Try:
ObjectId vId = version.checkIn(createMajorVersion, versionProperties, null, "");
AlfrescoDocument versionedDocument = (AlfrescoDocument) session.getObject(vId);
versionedDocument.setContentStream(versionContent, true);
node.setTargetId(vId.getId());
Or... If you're using later versions of Alfresco, try disabling the thumbnail server. The thumbnail service tries to asynchronously create a thumbnail and then add it to the document, which can collide with other checkout/checkins that are happening.
system.thumbnail.generate=false
Behaviors Firing Multiple Times
If you have Alfresco behaviors deployed that are getting called while you're migrating, there's a chance that you might be seeing your behaviors firing multiple times for each document that is created, especially if you have behaviors bound to the onUpdateProperties event.
While OpenMigrate only sends 1 CMIS HTTP call to Alfresco to create a document, when Alfresco receives the message, it makes multiple calls to the internal Java API to set properties. In some cases, we've seen as many as one call per property, which would cause and onUpdateProperties behavior to fire once per property as well.
To avoid this problem, make sure that the notification frequency of your behavior is set to TRANSACTION_COMMIT and not EVERY_EVENT. With TRANSACTION_COMMIT timing, the behaviors should only fire once per document being created.
public final void init()
{
policyComponent.bindClassBehaviour( OnUpdatePropertiesPolicy.QNAME, ContentModel.TYPE_CONTENT,
new JavaBehaviour(this, "onUpdateProperties", NotificationFrequency.TRANSACTION_COMMIT));
}