Accessing RTC repository from java class invoked by BIRT report
Hello all.
We are trying to create a birt report that uses a java class as the data source.
Following the steps described in the article:
We were able to call the class successfully from the BIRT report.
The java class needs to access the RTC repository in order to fetch the data it needs for it's calculations.
When we try calling the getService method, we get an exception.
When Calling:
getService(IRepositoryItemService.class)
We receive:
com.ibm.team.repository.common.transport.internal.registry.ServiceNotFoundException: The service 'com.ibm.test.pkg.TestAPI@2cc92cc9' failed to find the
required service 'interface com.ibm.team.repository.service.IRepositoryItemService'. Check <prerequisites>
in plugin.xml.
When Calling:
getService(IProcessServerService.class)
We receive:
com.ibm.team.repository.common.transport.internal.registry.ServiceNotFoundException: The service 'com.ibm.test.pkg.TestAPI@2cc92cc9' failed to find the
required service 'interface com.ibm.team.process.service.IProcessServerService'. Check <prerequisites> in plugin.xml.
The services are defined in the <prerequisites> of the fragment.xml
We also tried calling these services from a WorkItem Operation Advisor -
and in that case - everything worked just fine, and we were able to get the needed data from RTC.
So - the question is -
What should we do in order to access RTC services from a java class called from a BIRT report.
Many thanks in advance.
Shay
One answer
Comments
Hi Rafik.
Thanks a lot for the quick reply.
We found out that only the first instance of the class, an instance created when the server first starts up, has the ability to access the services.
And when we call
new pkg.ClassName();
from the report, the services are not available.
So we now hold a reference to the first instance, and rely on it to access the services for the instances required by the report.