Error creating versions

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
ranjeetsi
Established Member II

Error creating versions

For our custom project - (Using Alfresco 5.2.3)

Have a requirement to export all the versions of the document and then import at another repository.
Exports are fine but when we tried to import with all the versions, it is failing. 
For Eg. 
if the exported content has 3 versions (v1, v2 and v3). During import process we are trying to create base version node and then creating node for all other versions. while 
creating base node that is v1, it was created successfully. while creating node for v2, we are getting below error.
Error:
org.alfresco.service.cmr.version.VersionServiceException: 07129796 The current version label of the node does not exist in the version history.
Exception :
org.alfresco.service.cmr.version.VersionServiceException: 07129796 The current version label of the node does not exist in the version history.      at org.alfresco.repo.version.Version2ServiceImpl.createVersion(Version2ServiceImpl.java:267)      at org.alfresco.repo.version.Version2ServiceImpl.createVersion_aroundBody2(Version2ServiceImpl.java:141)      at org.alfresco.repo.version.Version2ServiceImpl$AjcClosure3.run(Version2ServiceImpl.java:1)


Code from where it fails:

Map<String, Serializable> versionProperties = new HashMap<String, Serializable> ();
versionProperties.put(VersionModel.PROP_VERSION_TYPE, VersionType.MAJOR);
versionProperties.put(Version.PROP_DESCRIPTION,"versioned");
versionService.createVersion(baseNode, versionProperties) ;

2 Replies
ranjeetsi
Established Member II

Re: Error creating versions

Can anyone please suggest in this.

hiten_rastogi1
Active Member II

Re: Error creating versions

Hi Ranjeet,

Replying a bit late but can you try the below before your code

versionService.ensureVersioningEnabled(nodeRef, null);