Java ClearCase Update on a HTTPS Server

我只是一个虾纸丫 提交于 2021-02-19 07:18:07

问题


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:


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.



来源:https://stackoverflow.com/questions/64065344/java-clearcase-update-on-a-https-server

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!