Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

Using AbstractMigrationHandler for Component Migration Fails

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?

0 votes


Be the first one to answer this question!

Register or log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,939

Question asked: Jul 08 '10, 3:23 a.m.

Question was seen: 4,217 times

Last updated: Jul 08 '10, 3:23 a.m.

Confirmation Cancel Confirm