[closed] Exception calling setArchived() using the Jazz Plain java cl
users, but I'm getting this exception when I call
IContributor.setArchived(true) ...
Exception in thread "main"
com.ibm.team.repository.common.internal.ImmutablePropertyException
at
com.ibm.team.repository.common.internal.util.ItemUtil$ProtectAdapter.notifyChanged(ItemUtil.java:2047)
at
org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify(BasicNotifierImpl.java:247)
at
com.ibm.team.repository.common.model.impl.ContributorImpl.setArchived(ContributorImpl.java:464)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:615)
at
com.ibm.team.repository.common.internal.util.ItemStore$ItemInvocationHandler.invoke(ItemStore.java:596)
at $Proxy7.setArchived(Unknown Source)
at
com.ibm.wasrtc.tools.ArchiveUsersNotInLDAP.main(ArchiveUsersNotInLDAP.java:107)
I'm effectively doing:
IContributorManager icm = teamRepository.contributorManager();
List<IContributor> allContribs = icm.fetchAllContributors(new
NullProgressMonitor());
then picking the IContributor I want from that list and calling:
contributor.setArchived(true);
Any help appreciated.
Thanks,
Jeremy
The question has been closed for the following reason: "The question is answered, right answer was accepted" by rschoon Nov 12 '16, 10:00 a.m.
Accepted answer
API rather than casting to IContributorService, but I'm glad you got it
working.
-
Matt Lavin
Jazz Server Team
On Mon, 2009-01-26 at 14:29 +0000, Jeremy Hughes wrote:
On 24/01/2009 04:37, Matt Lavin wrote:
In Balaji's example, I believe that getContributorService() was a
shortcut for calling
getService(com.ibm.team.repository.common.service.IContributorService.class) from a server side service.
From the client side you could use
com.ibm.team.repository.client.ITeamRepository.contributorManager() to
get an instance of com.ibm.team.repository.client.IContributorManager.
Thanks ... in the end this worked for me:
ITeamRepository teamRepository = login(repositoryURI, userId, password,
monitor);
// Have to cast the teamRepository to an IContributorService because
// getServiceInterface() isn't on the ITeamRepository interface
IContributorService ics =
(IContributorService)iclc.getServiceInterface(IContributorService.class);
IContributor workingCopy = (IContributor)contributor.getWorkingCopy();
workingCopy.setArchived(true);
ics.saveContributor(workingCopy);
Thanks,
Jeremy
5 other answers
IContributor workingCopy = contributor.getWorkingCopy();
workingCopy.setArchived(true);
getContributorService().saveContributor(workingCopy);
--- Balaji
Hi, I'm trying to use the Jazz Plain client libraries to archive some
users, but I'm getting this exception when I call
IContributor.setArchived(true) ...
Exception in thread "main"
com.ibm.team.repository.common.internal.ImmutablePropertyException
at
com.ibm.team.repository.common.internal.util.ItemUtil$ProtectAdapter.notifyChanged(ItemUtil.java:2047)
at
org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify(BasicNotifierImpl.java:247)
at
com.ibm.team.repository.common.model.impl.ContributorImpl.setArchived(ContributorImpl.java:464)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:615)
at
com.ibm.team.repository.common.internal.util.ItemStore$ItemInvocationHandler.invoke(ItemStore.java:596)
at $Proxy7.setArchived(Unknown Source)
at
com.ibm.wasrtc.tools.ArchiveUsersNotInLDAP.main(ArchiveUsersNotInLDAP.java:107)
I'm effectively doing:
IContributorManager icm = teamRepository.contributorManager();
List<IContributor> allContribs = icm.fetchAllContributors(new
NullProgressMonitor());
then picking the IContributor I want from that list and calling:
contributor.setArchived(true);
Any help appreciated.
Thanks,
Jeremy
You need to get the workingCopy of the contributor before setting a
value.
IContributor workingCopy = contributor.getWorkingCopy();
workingCopy.setArchived(true);
getContributorService().saveContributor(workingCopy);
I can't see getContributorService() or saveContributor() in the 1.0.1
plan java jars. Am I missing something.
Thanks,
Jeremy
shortcut for calling
getService(com.ibm.team.repository.common.service.IContributorService.class) from a server side service.
From the client side you could use
com.ibm.team.repository.client.ITeamRepository.contributorManager() to
get an instance of com.ibm.team.repository.client.IContributorManager.
-
Matt Lavin
Jazz Server Team
On Wed, 2009-01-21 at 17:38 +0000, Jeremy Hughes wrote:
On 21/01/2009 15:17, balajik wrote:
You need to get the workingCopy of the contributor before setting a
value.
IContributor workingCopy = contributor.getWorkingCopy();
workingCopy.setArchived(true);
getContributorService().saveContributor(workingCopy);
I can't see getContributorService() or saveContributor() in the 1.0.1
plan java jars. Am I missing something.
Thanks,
Jeremy
In Balaji's example, I believe that getContributorService() was a
shortcut for calling
getService(com.ibm.team.repository.common.service.IContributorService.class) from a server side service.
From the client side you could use
com.ibm.team.repository.client.ITeamRepository.contributorManager() to
get an instance of com.ibm.team.repository.client.IContributorManager.
Thanks ... in the end this worked for me:
ITeamRepository teamRepository = login(repositoryURI, userId, password,
monitor);
// Have to cast the teamRepository to an IContributorService because
// getServiceInterface() isn't on the ITeamRepository interface
IContributorService ics =
(IContributorService)iclc.getServiceInterface(IContributorService.class);
IContributor workingCopy = (IContributor)contributor.getWorkingCopy();
workingCopy.setArchived(true);
ics.saveContributor(workingCopy);
Thanks,
Jeremy
Comments
Hi,
Could anyone please tell me what iclc in the above lines is?
And I am also getting this error:
00:31:02,375 [1245989444@qtp-1917350472-33] ERROR com.ibm.team.process.common - The service 'net.jazz.rtcext.workitem.extensions.service.BuildOnStateChangeParticipant@52a252a2' failed to find the required service 'interface com.ibm.team.repository.common.service.IContributorService'. Check <prerequisites> in plugin.xml. java.lang.IllegalArgumentException: The service 'net.jazz.rtcext.workitem.extensions.service.BuildOnStateChangeParticipant@52a252a2' failed to find the required service 'interface com.ibm.team.repository.common.service.IContributorService'. Check <prerequisites> in plugin.xml.
Could anyone please guide me.
Thanks.