Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

Fail to invoke Java API of RTC in osgi bundles, need help

I am developing an application which invokes Java API of RTC. When the application runs in stand-alone J2SE, everything is fine.
However when the application runs in the osgi bundles, exception occurs.
Is there any limitation with invoking the Java API of RTC.

The error stack:
java.lang.IllegalArgumentException: The type name Contributor and the namespace URI com.ibm.team.repository do not resolve to an IItemType.
at com.ibm.team.repository.common.internal.querypath.AbstractQueryPathModel$Implementation.getItemType(AbstractQueryPathModel.java:190)
at com.ibm.team.repository.common.query.IQuery$Factory.newInstance(IQuery.java:92)
at com.ibm.team.repository.client.internal.ContributorManager.createAllContributorsQuery(ContributorManager.java:57)
at com.ibm.team.repository.client.internal.ContributorManager.<clinit>(ContributorManager.java:45)
at java.lang.J9VMInternals.initializeImpl(Native Method)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:200)
at com.ibm.team.repository.client.internal.TeamRepository.<init>(TeamRepository.java:387)
at com.ibm.team.repository.client.internal.TeamRepositoryService.createSharedTeamRepository(TeamRepositoryService.java:366)
at com.ibm.team.repository.client.internal.TeamRepositoryService.getTeamRepository(TeamRepositoryService.java:91)
at com.ibm.team.repository.client.internal.TeamRepositoryService.getTeamRepository(TeamRepositoryService.java:110)

0 votes



One answer

Permanent link
Never mind, I resolved the issue

When try to login RTC by using Java API.
ClassLoader loader = Thread.currentThread().getContextClassLoader();
Thread.currentThread().setContextClassLoader(TeamRepository.class.getClassLoader());

//your code to login RTC

Thread.currentThread().setContextClassLoader(loader);

0 votes

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,930

Question asked: Jun 21 '10, 11:17 p.m.

Question was seen: 5,921 times

Last updated: Jun 21 '10, 11:17 p.m.

Confirmation Cancel Confirm