Absent Member.
Absent Member.
1480 views

sample code ViewCompareMerge in SDK java cann't run

Jump to solution

I can not run ViewCompareMerge to my starteam server.

This example throw a exception "Cannot determine the match for Folder "InSite" of the Source view. In order to proceed, you must specify the corresponding Folder in the Target view."

console output:


Connecting to StarTeam server...
Total amount of free memory available to the JVM: 13266184(Bytes) 13(MBytes)
Maximum memory available to the JVM: 508887040(Bytes) 508(MBytes)
Total memory currently in use by the JVM (Bytes): 15925248(Bytes) 15(MBytes)
Committed virtual memory available to the JVM: 657403904(Bytes) 657(MBytes)
Free physical memory available to the JVM: 102178816(Bytes) 102(MBytes)
Total physical memory available to the operating system: 1050898432(Bytes) 1050(MBytes)


Connected to StarTeam server...


Starting vcm compare...
Total amount of free memory available to the JVM: 6131328(Bytes) 6(MBytes)
Maximum memory available to the JVM: 508887040(Bytes) 508(MBytes)
Total memory currently in use by the JVM (Bytes): 15925248(Bytes) 15(MBytes)
Committed virtual memory available to the JVM: 666030080(Bytes) 666(MBytes)
Free physical memory available to the JVM: 86880256(Bytes) 86(MBytes)
Total physical memory available to the operating system: 1050898432(Bytes) 1050(MBytes)


Completing vcm compare...
Total amount of free memory available to the JVM: 2685344(Bytes) 2(MBytes)
Maximum memory available to the JVM: 508887040(Bytes) 508(MBytes)
Total memory currently in use by the JVM (Bytes): 15925248(Bytes) 15(MBytes)
Committed virtual memory available to the JVM: 666030080(Bytes) 666(MBytes)
Free physical memory available to the JVM: 83628032(Bytes) 83(MBytes)
Total physical memory available to the operating system: 1050898432(Bytes) 1050(MBytes)

Cannot determine the match for Folder "InSite" of the Source view. In order to proceed, you must specify the corresponding Folder in the Target view.

Tags (3)
0 Likes
1 Solution

Accepted Solutions
Micro Focus Expert
Micro Focus Expert

The vcm compare phase runs 'silently' only if the source & target views are derived from each other, in which case, the root folder of the source view is pretty much guaranteed to have a corresponding share in the target view.

When running vcm against non-derived views, specifically when the root folder of the source view has no matching share in the target view, vcm throws an AmbiguousMatchException, whose text is 'Cannot determine the match for Folder..."

You can verify the same behavior through the Cross Paltform Client. Run a VCM session against the two views you selected, and see for yourself that the CPC will present you with a dialog box asking you to pick a folder from the target view that represents the root hierarchy folder to match to the source view root folder.

Also take a look at the unit test suite's com.starteam.test.viewcomparemerge.AllNonDerivedViewTests (junit.zip, downloadable from the ftp site)

ftp://us.ftp.microfocus.com/Starteam/st-sdk-14.0-readme.htm

To prevent the exception, you must manually match the source root folder to a target folder.

Change the sample source code, so that before the compare, you call the api

Session.setMatch(Item source, Item target)

/**

* Tells the VCM engine to match a specific source item to a specific target

* item. This overrides the normal comparison logic.

* <p>

* A client application can call setMatch() before calling compare() to

* avoid an AmbiguousMatchException.

*

* @param source

*            An item from the source view.

* @param target

*            The corresponding item from the target view.

*

* @see #compare

* @see AmbiguousMatchException

*/

public void setMatch(Item source, Item target) {

On the other hand, if your intent is simply to see the sample run successfully, pick a different view hierarchy where the child view derives from the parent...

View solution in original post

0 Likes
1 Reply
Micro Focus Expert
Micro Focus Expert

The vcm compare phase runs 'silently' only if the source & target views are derived from each other, in which case, the root folder of the source view is pretty much guaranteed to have a corresponding share in the target view.

When running vcm against non-derived views, specifically when the root folder of the source view has no matching share in the target view, vcm throws an AmbiguousMatchException, whose text is 'Cannot determine the match for Folder..."

You can verify the same behavior through the Cross Paltform Client. Run a VCM session against the two views you selected, and see for yourself that the CPC will present you with a dialog box asking you to pick a folder from the target view that represents the root hierarchy folder to match to the source view root folder.

Also take a look at the unit test suite's com.starteam.test.viewcomparemerge.AllNonDerivedViewTests (junit.zip, downloadable from the ftp site)

ftp://us.ftp.microfocus.com/Starteam/st-sdk-14.0-readme.htm

To prevent the exception, you must manually match the source root folder to a target folder.

Change the sample source code, so that before the compare, you call the api

Session.setMatch(Item source, Item target)

/**

* Tells the VCM engine to match a specific source item to a specific target

* item. This overrides the normal comparison logic.

* <p>

* A client application can call setMatch() before calling compare() to

* avoid an AmbiguousMatchException.

*

* @param source

*            An item from the source view.

* @param target

*            The corresponding item from the target view.

*

* @see #compare

* @see AmbiguousMatchException

*/

public void setMatch(Item source, Item target) {

On the other hand, if your intent is simply to see the sample run successfully, pick a different view hierarchy where the child view derives from the parent...

View solution in original post

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.