How to find the workspace programatically?
How to find the repository workspace programmatically when workspace name is known?
Workspace manager does not provide any method to get the IWorkspaceConnection to a particular workspace whose name is know. It provides the createWorkspace method which returns IWorkspaceConnection but how to find a IWorkspaceConnection on an existing workspace?
Workspace manager does not provide any method to get the IWorkspaceConnection to a particular workspace whose name is know. It provides the createWorkspace method which returns IWorkspaceConnection but how to find a IWorkspaceConnection on an existing workspace?
8 answers
IWorkspaceManager.findWorkspacesByName() gives IItemQueryPage, iterating
through which I can get the IWorkspaceHandle for a required workspace.
Now how can I get IWorkspaceConnection from this?
IWorkspaceManager has a getWorkspaceConnection() method that takes a
workspace handle and returns a connection.
- Dmitry
Here is the trace:
log4j:WARN No appenders could be found for logger (com.ibm.team.repository).
log4j:WARN Please initialize the log4j system properly.
Contacting https://localhost:9443/jazz/...
Connected
Exception in thread "main" java.lang.NullPointerException
at com.ibm.team.scm.client.internal.ScmServiceInterfaceProxy.notifyProcess(ScmServiceInterfaceProxy.java:127)
at com.ibm.team.scm.client.internal.ScmServiceInterfaceProxy.invoke(ScmServiceInterfaceProxy.java:95)
at $Proxy10.findWorkspacesByName(Unknown Source)
at com.ibm.team.scm.client.internal.WorkspaceManager.findWorkspacesByName(WorkspaceManager.java:1051)
at com.ibm.rational.connector.cmvc.Synch.findSyncWorkspace(Synch.java:74)
at com.ibm.rational.connector.cmvc.Synch.createChangeSetForCmvc(Synch.java:97)
at com.ibm.rational.connector.cmvc.Synch.main(Synch.java:43)
log4j:WARN No appenders could be found for logger (com.ibm.team.repository).
log4j:WARN Please initialize the log4j system properly.
Contacting https://localhost:9443/jazz/...
Connected
Exception in thread "main" java.lang.NullPointerException
at com.ibm.team.scm.client.internal.ScmServiceInterfaceProxy.notifyProcess(ScmServiceInterfaceProxy.java:127)
at com.ibm.team.scm.client.internal.ScmServiceInterfaceProxy.invoke(ScmServiceInterfaceProxy.java:95)
at $Proxy10.findWorkspacesByName(Unknown Source)
at com.ibm.team.scm.client.internal.WorkspaceManager.findWorkspacesByName(WorkspaceManager.java:1051)
at com.ibm.rational.connector.cmvc.Synch.findSyncWorkspace(Synch.java:74)
at com.ibm.rational.connector.cmvc.Synch.createChangeSetForCmvc(Synch.java:97)
at com.ibm.rational.connector.cmvc.Synch.main(Synch.java:43)
That NPE means that the process client library was not found for some
reason. Not sure what is happening exactly. What set of jazz client
bundles do you run with?
vkcind wrote:
reason. Not sure what is happening exactly. What set of jazz client
bundles do you run with?
vkcind wrote:
Here is the trace:
log4j:WARN No appenders could be found for logger
(com.ibm.team.repository).
log4j:WARN Please initialize the log4j system properly.
Contacting https://localhost:9443/jazz/...
Connected
Exception in thread "main" java.lang.NullPointerException
at
com.ibm.team.scm.client.internal.ScmServiceInterfaceProxy.notifyProcess(ScmServiceInterfaceProxy.java:127)
at
com.ibm.team.scm.client.internal.ScmServiceInterfaceProxy.invoke(ScmServiceInterfaceProxy.java:95)
at $Proxy10.findWorkspacesByName(Unknown Source)
at
com.ibm.team.scm.client.internal.WorkspaceManager.findWorkspacesByName(WorkspaceManager.java:1051)
at
com.ibm.rational.connector.cmvc.Synch.findSyncWorkspace(Synch.java:74)
at
com.ibm.rational.connector.cmvc.Synch.createChangeSetForCmvc(Synch.java:97)
at com.ibm.rational.connector.cmvc.Synch.main(Synch.java:43)