It's all about the answers!

Ask a question

Using AbstractMigrationHandler for Component Migration Fails


Senthil Mani (122) | asked Jul 08 '10, 3:23 a.m.
We currently have component model and the corresponding repository with data in Jazz 1.0.0.1. I am trying to migrate this data to Jazz 2 repository. I have written a specific migration handler which extends AbstractMigrationHandler and just overrides the preSave() method as follows.
----------------------------------------------------------------------------------
@Override
public IItem preSave(IItem item, boolean isCurrent, IUnknownProperties unknownProperties) throws TeamRepositoryException {
// links are public
System.out.println("Setting context id to public");
setPublicContext(item);
return item;
}
----------------------------------------------------------------------------------

Also in the plugin.xml - i have this proper extension point definition.
---------------------------------------------------------------------------------
<extension>
<migrationHandler>
<extensionService>
</extensionService>
</migrationHandler>
</extension>>
-------------------------------------------------------------------------------------

The component Id to which the model is attached is "com.example.model" and i have the MyMigrationHandler to do the migration.

However, when i try run the repotools -import, there are errors in the log as follows:
------------------------------------------------------------------------------------
Required property must not be null: contextId
at com.ibm.team.repository.service.internal.RdbRepositoryDataMediator.failIfNecessary(RdbRepositoryDataMediator.java:366)
at com.ibm.team.repository.service.internal.RdbRepositoryDataMediator.validateItem(RdbRepositoryDataMediator.java:348)
at com.ibm.team.repository.service.internal.RdbRepositoryDataMediator.importItem(RdbRepositoryDataMediator.java:2267)
at com.ibm.team.repository.service.internal.RdbRepositoryDataMediator.importSimpleItem(RdbRepositoryDataMediator.java:2243)
at com.ibm.team.repository.service.internal.RepositoryImportService.doImportSimpleItem(RepositoryImportService.java:274)
at com.ibm.team.repository.service.internal.RepositoryImportService.access$6(RepositoryImportService.java:266)
------------------------------------------------------------------------------------

Look like the MyMigrationHandler.preSave never gets executed.
Can someone help me here?

Be the first one to answer this question!


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.