Java ClearCase更新在HTTPS服务器上。

huangapple go评论70阅读模式
英文:

Java ClearCase Update on a HTTPS Server

问题

我正在尝试自动化ClearCase,以便可以进行自动构建。第一步是通过脚本更新视图。我正在尝试使用以下Java代码:

StpProvider provider = (StpProvider) ProviderFactory.createProvider(
                CcProvider.NETWORK_PROVIDER_CLASS, callback);
provider.setServerUrl("https://...");
CcProvider m_provider = provider.ccProvider();
m_provider.registerTrustManagerCallback(callback);
File viewRoot = new File("D:\\Views\\...");
StpLocation viewLocation = provider.filePathLocation(StpProvider.Domain.CLEAR_CASE, viewRoot);

//获取表示CCRC视图的CcView实例。
CcView view = m_provider.ccView(viewLocation);

//在更新视图时的选项
CcFile.RefreshFlag[] refreshFlags = new CcFile.RefreshFlag[1];
refreshFlags[0] = CcFile.RefreshFlag.KEEP_HIJACKS;

PropertyRequestItem.PropertyRequest properties = new PropertyRequestItem.PropertyRequest(CcView.DISPLAY_NAME, CcView.CONFIG_SPEC);

view.doRefresh(refreshFlags, properties);

MyCallback只是一个Callback和CcTrustManagerCallback的简单实现,没有额外的逻辑。我得到了以下错误:

Exception in thread "main" CcException: CRMAP7009: Command "Update" failed:

CCRC WAN Server: Error: Unable to get view handle.
Error: "java.io.IOException: Status(1001:hasNonOkMsg):

CCRC WAN Server: Error: Unable to get view handle."
   reason:   conflict
   resource: view: cc.file:D:/Views/...
at com.ibm.rational.stp.client.internal.cc.Util.ccrcCmdStatusToWvcmException(Util.java:296)
at com.ibm.rational.stp.client.internal.cc.Util.runCommandAndCheckResults(Util.java:160)
at com.ibm.rational.stp.client.internal.cc.WebViewRefresh.run(WebViewRefresh.java:233)
at com.ibm.rational.stp.client.internal.cc.CcFileImpl.doCcRefresh(CcFileImpl.java:392)
at com.ibm.rational.stp.client.internal.cc.CcFileImpl.doRefresh(CcFileImpl.java:381)
at cc.UpdateView.main(UpdateView.java:45)

有人知道如何解决这个冲突吗?ClearTeam Explorer正常工作,我通过Eclipse插件手动更新。ClearCase版本为9.0.1.4,ClearTeam Explorer版本为9.0.1.08。使用Java 8。

英文:

I am trying to automate ClearCase, so I can do automatic building. The first step is to update a view by script. I am trying this with the following Java code:

		StpProvider provider = (StpProvider) ProviderFactory.createProvider(
                CcProvider.NETWORK_PROVIDER_CLASS, callback);
		provider.setServerUrl("https://...");
		CcProvider m_provider = provider.ccProvider();
		m_provider.registerTrustManagerCallback(callback);
		File viewRoot = new File("D:\\Views\\...");
		StpLocation viewLocation = provider.filePathLocation(StpProvider.Domain.CLEAR_CASE, viewRoot);
		
		//Get instance of CcView that represents the CCRC view.
		CcView view = m_provider.ccView(viewLocation);
		
		//Options while updating view
		CcFile.RefreshFlag[] refreshFlags = new CcFile.RefreshFlag[1];
		refreshFlags[0] = CcFile.RefreshFlag.KEEP_HIJACKS;
		
		PropertyRequestItem.PropertyRequest properties = new PropertyRequestItem.PropertyRequest(CcView.DISPLAY_NAME, CcView.CONFIG_SPEC);
		
		view.doRefresh(refreshFlags, properties);

MyCallback is just a simple Implementation of Callback and CcTrustManagerCallback, with no extra logic to it. I get the following error:

Exception in thread "main" CcException: CRMAP7009: Der Befehl "Update" ist fehlgeschlagen: 

CCRC WAN Server: Error: Unable to get view handle.
Fehler: "java.io.IOException: Status(1001:hasNonOkMsg): 

CCRC WAN Server: Error: Unable to get view handle.
" 
   reason:   conflict
   resource: view: cc.file:D:/Views/...
	at com.ibm.rational.stp.client.internal.cc.Util.ccrcCmdStatusToWvcmException(Util.java:296)
	at com.ibm.rational.stp.client.internal.cc.Util.runCommandAndCheckResults(Util.java:160)
	at com.ibm.rational.stp.client.internal.cc.WebViewRefresh.run(WebViewRefresh.java:233)
	at com.ibm.rational.stp.client.internal.cc.CcFileImpl.doCcRefresh(CcFileImpl.java:392)
	at com.ibm.rational.stp.client.internal.cc.CcFileImpl.doRefresh(CcFileImpl.java:381)
	at cc.UpdateView.main(UpdateView.java:45)

Does anyone know how to resolve this conflict ? ClearTeam Explorer is working, I am manually updating via the Eclipse plugin. ClearCase Version 9.0.1.4 and ClearTeam Explorer Version Version: 9.0.1.08. Using Java 8.

答案1

得分: 1

最终问题已解决,感谢 @Abra 提供的回答。但问题仅在于我必须将 PRIMARY_GROUP 设置为正确的组。

如果你遇到类似的错误,请首先检查 CC 操作是否与 ClearTeamExplorer 或正常的 ClearCase 工作一致,然后检查配置情况,并确保 CLI 的设置相同。

英文:

Finally solved the problem, thank you @Abra for your responses. But the problem was only that I had to set the PRIMARY_GROUP to the correct group.

If you have an error like this, first check out if CC operations with ClearTeamExplorer or normal ClearCase work and then check out how it is configured and make sure to have the same settings for the CLI.

huangapple
  • 本文由 发表于 2020年9月25日 21:41:54
  • 转载请务必保留本文链接:https://go.coder-hub.com/64065344.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定