It's all about the answers!

Ask a question

Exception while instantiating IChangeEventService


Raza Abbas Syed (164) | asked Feb 17 '09, 5:06 p.m.
I'm trying to setup a notification mechanism using the Jazz Feed Service. As a first step, I'm trying to setup IChangeEventService on the server for sending the necessary information to the client when certain events occur. I'm following an example on how to instantitate the IChangeEventService object but am getting the following error:
"The service 'edu.ncsu.csc.wolfpoker.jazz.service.NewPokerSessionService@17261726' failed to find the required service 'interface com.ibm.team.repository.common.service.IChangeEventService'. Check <prerequisites> in plugin.xml."

The piece of code I wrote is:

IChangeEventService changeEventService = getService(IChangeEventService.class);
IChangeEvent changeEvent = IChangeEvent.FACTORY.newInstance(session);
changeEventService.save(changeEvent);

The line in bold throws the said exception. And btw, com.ibm.team.repository.common is already in the dependencies.

4 answers



permanent link
Raza Abbas Syed (164) | answered Feb 23 '09, 2:30 p.m.
It worked! Thanks for your help!

permanent link
Matt Lavin (2.7k2) | answered Feb 20 '09, 8:48 a.m.
FORUM MODERATOR / JAZZ DEVELOPER
Yes, that is what I was looking for. It looks to me like your service
depends on com.ibm.team.repository.common.service.IQueryService and
com.ibm.team.repository.service.IRepositoryItemService. If you would
like to use the IChangeEventService then you should add a new
<requiredService> block that lists the IChangeEventService

-
Matt Lavin
Jazz Server Team


On Fri, 2009-02-20 at 03:17 +0000, razzman wrote:
extension

point="com.ibm.team.repository.service.serviceProvider"
serviceProvider
componentId="edu.ncsu.csc.wolfpoker.jazz"

implementationClass="edu.ncsu.csc.wolfpoker.jazz.service.NewPokerSessionService"
provides
providedService

interface="edu.ncsu.csc.wolfpoker.jazz.common.IWolfPokerService"
/providedService></provides></prerequisites
/serviceProvider
/extension

Is that what you were looking for?

permanent link
Raza Abbas Syed (164) | answered Feb 19 '09, 10:08 p.m.
<extension

point="com.ibm.team.repository.service.serviceProvider">
<serviceProvider
componentId="edu.ncsu.csc.wolfpoker.jazz"
implementationClass="edu.ncsu.csc.wolfpoker.jazz.service.NewPokerSessionService">
<provides>
<providedService
interface="edu.ncsu.csc.wolfpoker.jazz.common.IWolfPokerService">
</providedService></provides>
<prerequisites>
<requiredService
interface="com.ibm.team.repository.common.service.IQueryService">
</requiredService>
<requiredService
interface="com.ibm.team.repository.service.IRepositoryItemService">
</requiredService></prerequisites>
</serviceProvider>
</extension>


Is that what you were looking for?

permanent link
Matt Lavin (2.7k2) | answered Feb 19 '09, 9:58 a.m.
FORUM MODERATOR / JAZZ DEVELOPER
It sounds like your service definition is missing the dependency on
com.ibm.team.repository.common.service.IChangeEventService. I know you
said that com.ibm.team.repository.common was in the dependencies, but
"com.ibm.team.repository.common" isn't a service that you can depend on.
Can you copy your serviceProvider extension into this thread so we can
see if you have setup your dependency correctly?

-
Matt Lavin
Jazz Server Team


On Tue, 2009-02-17 at 22:07 +0000, razzman wrote:
I'm trying to setup a notification mechanism using the Jazz Feed
Service. As a first step, I'm trying to setup IChangeEventService on
the server for sending the necessary information to the client when
certain events occur. I'm following an example on how to instantitate
the IChangeEventService object but am getting the following error:
"The service
'edu.ncsu.csc.wolfpoker.jazz.service.NewPokerSessionService@17261726'
failed to find the required service 'interface
com.ibm.team.repository.common.service.IChangeEventService'. Check
prerequisites> in plugin.xml."

The piece of code I wrote is:

IChangeEventService changeEventService =
getService(IChangeEventService.class);
IChangeEvent changeEvent = IChangeEvent.FACTORY.newInstance(session);
changeEventService.save(changeEvent);

The line in bold throws the said exception. And btw,
com.ibm.team.repository.common is already in the dependencies.

Your answer


Register or to post your answer.