Jazz Register Log in
Jazz Forum Welcome to the Jazz Community Forum

Welcome to the Jazz Community Forum

Connect and collaborate with IBM Engineering experts and users

com.ibm.team.scm.common.ComponentNotInWorkspaceException

Hi,
I am getting the following exception when i tried to get the IConfiguration for a IComponentHandle.

Code I tried:
***********

IItemManager itemManager = repository.itemManager();
IComponentSearchCriteria comSearch = IComponentSearchCriteria.FACTORY.newInstance();
List<IComponentHandle> comHandles = workspaceManager.findComponents(comSearch, Integer.MAX_VALUE, null);
List<IComponent> iComponents = itemManager.fetchCompleteItems(comHandles, Integer.MAX_VALUE, null);
IComponentHandle componentHandle = iComponents.get(0);
IWorkspaceHandle wshandle = handles.get(0);
IWorkspaceConnection workspaceConnection = workspaceManager.getWorkspaceConnection(wshandle, null);
IConfiguration configuration = workspaceConnection.configuration(componentHandle);

Exception :
**********
com.ibm.team.scm.common.ComponentNotInWorkspaceException: Component is not in workspace
at com.ibm.team.scm.client.internal.FlowNodeConnection.checkKnownComponent(FlowNodeConnection.java:1361)
at com.ibm.team.scm.client.internal.FlowNodeConnection.configuration(FlowNodeConnection.java:935)
at com.smi.tools.eclipse.basic.actions.remote.GetFileFromServerActionDelegate.run(GetFileFromServerActionDelegate.java:218)
at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginAction.java:251)
at org.eclipse.ui.internal.WWinPluginAction.runWithEvent(WWinPluginAction.java:229)
at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:583)
at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:500)
at org.eclipse.jface.action.ActionContributionItem$6.handleEvent(ActionContributionItem.java:452)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3823)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3422)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2384)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2348)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2200)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:495)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:288)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:490)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:113)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:193)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:386)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:618)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:549)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
at org.eclipse.equinox.launcher.Main.run(Main.java:1236)
at org.eclipse.equinox.launcher.Main.main(Main.java:1212)

How to avoid this exception? Also is it possible to get IConfiguration for a component not loaded in the workspace?

0 votes



One answer

Permanent link
It probably is just as the exception says. Where is your workspace handle
coming from? How do you know it contains the component returned by the
search?

You can iterate through workspaceConnection.getComponents() to see whether
or not your workspace contains that particular components.

On Sun, 06 Dec 2009 08:38:02 -0500, yasararafath
<arafathcse> wrote:

Hi,
I am getting the following exception when i tried to get the
IConfiguration for a IComponentHandle.

Code I tried:
***********

IItemManager itemManager = repository.itemManager();
IComponentSearchCriteria comSearch =
IComponentSearchCriteria.FACTORY.newInstance();
List<IComponentHandle> comHandles =
workspaceManager.findComponents(comSearch, Integer.MAX_VALUE, null);

List<IComponent> iComponents =
itemManager.fetchCompleteItems(comHandles, Integer.MAX_VALUE, null);

IComponentHandle componentHandle = iComponents.get(0);
IWorkspaceHandle wshandle = handles.get(0);
IWorkspaceConnection workspaceConnection =
workspaceManager.getWorkspaceConnection(wshandle, null);
IConfiguration configuration =
workspaceConnection.configuration(componentHandle);

Exception :
**********
com.ibm.team.scm.common.ComponentNotInWorkspaceException: Component
is not in workspace
at
com.ibm.team.scm.client.internal.FlowNodeConnection.checkKnownComponent(FlowNodeConnection.java:1361)

at
com.ibm.team.scm.client.internal.FlowNodeConnection.configuration(FlowNodeConnection.java:935)

at
com.smi.tools.eclipse.basic.actions.remote.GetFileFromServerActionDelegate.run(GetFileFromServerActionDelegate.java:218)
at
org.eclipse.ui.internal.PluginAction.runWithEvent(PluginAction.java:251)

at
org.eclipse.ui.internal.WWinPluginAction.runWithEvent(WWinPluginAction.java:229)

at
org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:583)

at
org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:500)

at
org.eclipse.jface.action.ActionContributionItem$6.handleEvent(ActionContributionItem.java:452)

at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
at
org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3823)

at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3422)

at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2384)

at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2348)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2200)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:495)
at
org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:288)

at
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:490)

at
org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)

at
org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:113)

at
org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:193)

at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)

at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)

at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:386)

at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)

at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:618)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:549)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
at org.eclipse.equinox.launcher.Main.run(Main.java:1236)
at org.eclipse.equinox.launcher.Main.main(Main.java:1212)

How to avoid this exception? Also is
it possible to get IConfiguration for a component not loaded in the
workspace?



--

0 votes

Your answer

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,984

Question asked: Dec 06 '09, 8:28 a.m.

Question was seen: 6,067 times

Last updated: Dec 06 '09, 8:28 a.m.

Confirmation Cancel Confirm