It's all about the answers!

Ask a question

IContributor from IContributorHandle

Prakash Behrani (28910) | asked Aug 11 '14, 9:48 a.m.
I am using the following code sample to try to retrieve IContributor from IContributorHandle in a advisor, which I had noticed on another forum post:

                IContributorHandle owner = workItem.getOwner();
                IRepositoryItemService itemService = getService(IRepositoryItemService.class);               
                IContributor user = (IContributor) itemService.fetchItem(owner, null);

I don't see any compilation errors in the project.

However, when the advisor runs, I get  the following error:
An unhandled exception occurred during "Check Owner Advisor".

The service 'com.pb.CheckOwnerAdvisor@35f835f8' failed to find the required service 'interface'.  Check <prerequisites> in plugin.xml.

I would deeply appreciate feedback on the issue.


Accepted answer

permanent link
Susan Hanson (1.6k2201194) | answered Aug 11 '14, 9:55 a.m.
Check the particpants plugin.xml, there is a <prerequisites> block.
You'll need to be sure you have
                    <requiredService interface=""/>   
Prakash Behrani selected this answer as the correct answer

Prakash Behrani commented Aug 11 '14, 10:44 a.m.

When I add prerequisites, I am getting a warning that prerequisites is not legal as a child of element extensionService.  Is this warning normal?


Susan Hanson commented Aug 11 '14, 10:50 a.m.

yea, i get that warning

3 other answers

permanent link
Dinesh Kumar B (4.1k413) | answered Aug 11 '14, 10:09 a.m.
if you have the manifest file open in the eclipse editor, you may want to look at the dependencies tab. 

You must have an entry here for 

If you dont find it, please revisit your Target Platform to add the required library to it and add the dependency in the plugin configuration. 

hope this helps.

Prakash Behrani commented Aug 11 '14, 10:17 a.m.

I don't see the Prerequisite block in plugin.xml. I could try adding it to see if it makes a difference as was pointed out by previous comment.

However, here is the content of the manifest, which does show the Require bundle:

Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Rtc_check_owner_advisor
Bundle-SymbolicName: rtc_check_owner_advisor;singleton:=true
Bundle-Version: 1.0.0.qualifier
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Import-Package: org.eclipse.core.runtime;version="3.4.0"

Dinesh Kumar B commented Aug 11 '14, 2:37 p.m.

the manifest content looks ok to me.. i have 403 setup with similar manifest file and the operation advisor thus created works well....

yes, though i dont see the <prerequisite> on my plugin.xml, you may still want to try the suggestion from Susan... let us know how it goes

permanent link
sam detweiler (12.5k6195201) | answered Aug 11 '14, 11:05 a.m.
the prereq block is optional..    here is part of a plugin.xml for one of my plugins
you can get to it from the plugin.xml editor UI as well.. right click on the elements in the Extensions tab for additional items. (see image below)

            name="Create Approval Participant"
                    <requiredService interface=""/>   
                    <requiredService interface=""/>        
                    <requiredService interface=""/>
                    <requiredService interface=""/>
                    <requiredService interface=""/>
                    <requiredService interface=""/> 
              some description here

permanent link
Prakash Behrani (28910) | answered Aug 11 '14, 5:26 p.m.
Thanks Susan, Mark.
Adding the prerequisite block helped.

Your answer

Register or to post your answer.