It's all about the answers!

Ask a question

Element 'prerequisites' is not legal as a child of element '


Jose Miguel Ordax Cassa (2.4k2118100) | asked Dec 01 '09, 12:23 p.m.
I have this warning in my Plug-in Descriptor. Where should it go?
All examples I have found add 'prerequisites' as a child of
'extensionService' element.

Thanks in advance,

Chemi.

4 answers



permanent link
Jared Burns (4.4k29) | answered Dec 04 '09, 10:22 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
On Tue, 01 Dec 2009 18:15:43 +0100, Chemi wrote:

I have this warning in my Plug-in Descriptor. Where should it go? All
examples I have found add 'prerequisites' as a child of
'extensionService' element.

Thanks in advance,

Chemi.

Sounds like what you're doing is correct. You might just be seeing an
error in the schema of the extension-point you're extending.

--
Jared Burns
Jazz Process Team

permanent link
ANIL ABRAHAM (2321824) | answered Sep 19 '12, 6:35 p.m.

Jared

Iam getting the same issue. The error iam getting over "<requiredService interface="com.ibm.team.process.internal.common.service.IProcessService"/>"

   Can you suggest the Schema ?  Below is my plugin.xml

<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
   <extension
         id="TestWorldAdvisor.prohibitSave"
         name="Prohibit Save (Test World Advisor)"
         point="com.ibm.team.process.service.operationAdvisors">
      <operationAdvisor
            class="testworldadvisor.TestWorldProhibitSave"
            id="TestWorldAdvisor.prohibitSave"
            name="Prohibit Save (Test World Advisor)"
            operationId="com.ibm.team.workitem.operation.workItemSave">
            </operationAdvisor>
       <prerequisites>
   <requiredService interface="com.ibm.team.process.internal.common.service.IProcessService"/>
   </prerequisites>
   </extension>
</plugin>


permanent link
Idan Shanny (124) | answered Mar 24 '13, 4:00 a.m.
 I'm having the same problem.
When trying to run this command:
IMailerService mailerService = getService(IMailerService.class);
in the Java code, the following exception occurs:
"The service '...' fails to find the required service 'interface com.ibm.team.repository.service.IMailerService'. Check <prerequisites> in plugin.xml."
When trying to add the <prerequisites> tag to plugin.xml, I get a warning that

"Element 'prerequisites' is not legal as a child of element..."

regardless of the position I put that tag.

What am I missing here? What am I doing wrong?!

this is the plugin.xml before adding the <prerequisites> tag:
======================================
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
   <extension
         point="com.ibm.team.process.service.operationAdvisors">
      <operationAdvisor
            class="br.com.bello.IdanTildaCheckAdvisor"
            id="idanTildaCheckAdvisor.operationAdvisor"
            name="IdanTildaCheckAdvisor"
            operationId="com.ibm.team.workitem.operation.workItemSave">
         <extensionService
               componentId="br.com.bello.IdanTildaCheckAdvisor"
               implementationClass="br.com.bello.IdanTildaCheckAdvisor"> 
         </extensionService>
      </operationAdvisor>
   </extension>
</plugin>
====================================

And these are the 3 lines I'm trying to add:

<prerequisites>
<requiredService interface="com.ibm.team.workitem.service.IMailerService"/>
</prerequisites> 

permanent link
Ralph Schoon (55.5k23642) | answered Mar 25 '13, 11:55 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
The warning "Element 'prerequisites' is not legal as a child of element..." is the result of the schema definition for the extension point you are extending. I am not sure about the background and why it does not get fixed. However, you require the prerequisites. If you try to getService() services and they are not in the prerequisites, you get errors.

You can ignore the warning. If you add the prerequisites as described in https://jazz.net/library/article/1000 for example there should be no issue. You might however run into problems if you add prerequisites that are not real services. You should see that during server start up.

Comments
Albert Yao commented Nov 17 '13, 8:44 a.m.

Why it does not get fixed?

It is very confusing and misleading!!! 

Your answer


Register or to post your answer.