Exception in finding Unresollved using plain java api?
I am trying to find out all the Unresolved changes of the loaded workspace(Loaded with the help of load file)
Code:
ISharingManager sm = FileSystemCore.getSharingManager();
ILocalChangeManager lcm = sm.getLocalChangeManager();
String target = "HWRef";
PathLocation pathlocation = new PathLocation(projectConfiguration.getSandBoxLocation() );
ILocation sandBoxLocation = pathlocation.getCanonicalForm();
String[] targetPaths = target.split("/");
ISandbox sbox = sm.getSandbox(sandBoxLocation, false);
System.out.println(sbox.getRoot());
IShare[] sss= sbox.allShares(null);
IRelativeLocation relativeLocation = new RelativeLocation(Arrays.asList(targetPaths));
IShareable shareable = sbox.findShareable(relativeLocation, ResourceType.FOLDER);
lcm.refreshChanges(new ISandbox[] { sbox },RefreshType.TRAVERSE_ALL_WITH_RECOMPUTE_OF_KNOWN, null);
ILocalChange[] localChanges = lcm.getPendingChanges(new IShareable[] { shareable }, null);
In the localChanges it was showing as:
"org.eclipse.debug.core.DebugException: com.sun.jdi.ClassNotLoadedException: Type has not been loaded occurred while retrieving component type of array."
i have used another method of localChanges but got same message.
IShare[] shares= sbox.allShares(null);
ILocalChange[] localChanges1 = lcm.getPendingChanges(shares);
Thanks in advance!!
One answer
Usually you should only need a JDK and the Plain Java Client Libraries in your class path, otherwise you use SDK or other classes you probably shouldn't.
Comments
Thanks for suggestion,
getPendingChanges is working fine if I load the project normally with this below code
IShare[] shares= sbox.allShares(null);
ILocalChange[] localChanges1 = lcm.getPendingChanges(shares);
but when i load the project with a "Load Rule File" and try to fetch pending changes i am getting the exception.
"org.eclipse.debug.core.DebugException: com.sun.jdi.ClassNotLoadedException: Type has not been loaded occurred while retrieving component type of array."
Please let me know whether the problem is due to this loading from rule file or please provide some alternative to get pending changes when loaded through rule file.
How on earth should I know where this comes from and how to fix it? I can only suggest to wonder about the class loader and to try to debug where the load happens and what goes wrong.
Another suggestion I would have is to paste "org.eclipse.debug.core.DebugException: com.sun.jdi.ClassNotLoadedException" into Google search and look at the various hits, especially on StackOverflow to figure if there is something relevant for your situation.
Comments
vikas v
Mar 17 '16, 6:39 a.m.Thanks for suggestion,
getPendingChanges is working fine if I load the project normally with this below code
IShare[] shares= sbox.allShares(null);
ILocalChange[] localChanges1 = lcm.getPendingChanges(shares);
but when i load the project with a "Load Rule File" and try to fetch pending changes i am getting the exception.
"org.eclipse.debug.core.DebugException: com.sun.jdi.ClassNotLoadedException: Type has not been loaded occurred while retrieving component type of array."
Please let me know whether the problem is due to this loading from rule file or please provide some alternative to get pending changes when loaded through rule file.