It's all about the answers!

Ask a question

Unable to implement Rational Team Concert (RTC) plain jars to create work items via REST API calls from a WebSphere Server Application

Ruifeng Ma (1112) | asked Dec 02 '15, 3:52 a.m.
edited Dec 16 '15, 5:09 a.m.
When trying to integrate RTC plain jars into a customized WebSphere server application, exception occurred at below code line.

this.teamRepository = TeamPlatform.getTeamRepositoryService().getTeamRepository(this.repositoryURI);

[12/2/15 16:04:19:883 SGT] 000000a4 BusinessExcep E CNTR0020E: EJB threw an unexpected (non-declared) exception during invocation of method "createTestAutoDefect" on bean "BeanId(RTCWebClientEAR#RTCWebClient.war#RTCWorkItemHandler, null)". Exception data: java.lang.NoClassDefFoundError: (initialization failure) at java.lang.J9VMInternals.initialize( at at at at


Caused by: java.lang.IllegalArgumentException: The type name Contributor and the namespace URI do not resolve to an IItemType. at$Implementation.getItemType( at$Factory.newInstance( at at at java.lang.J9VMInternals.initializeImpl(Native Method) at java.lang.J9VMInternals.initialize( at at at at

It seems classes in the RTC plain jars are not properly loaded.

Those jars were put into the library folder of the EAR that hosts the web project that implements RTC functions.

Ruifeng Ma commented Dec 16 '15, 7:11 a.m. | edited Dec 16 '15, 7:11 a.m.

Similar issue was also discussed in this RTC enhancement work item: 

3 answers

permanent link
Ruifeng Ma (1112) | answered Dec 16 '15, 5:08 a.m.
edited Dec 16 '15, 5:08 a.m.
Resolved the issue by tweaking WebSphere's class loading behavior as below:

In the RAD (eclipase core) IDE, right Click on the EAR that contains the web project for RTC client -> Java EE -> Open WebSphere Application Server Deployment, go to Application section and make Classloader mode: PARENT_LAST and WAR classloader policy: APPLICATION

Found this solution via:

The cause could most likely be because of missing plugin configurations in eclipse classes, resulting from class loading behavior.

WebSphere is implemented through OSGI technology like eclipse, hence the eclipse platform classes by default are loaded from WebSphere, not the RTC client libraries (plain RTC jar files) included in the EAR application.

Hence a possible solution would be to reverse the class loading policy.

permanent link
Kevin Ramer (4.5k8180199) | answered Dec 16 '15, 11:26 a.m.
There are several steps to adding classes to a websphere application. Some are within WebSphere, some within the deployment descriptor of the application itself.  This document does a pretty good job and if memory serves helped me add Plain Java client to a custom application for user access requests.

Ruifeng Ma commented Dec 30 '15, 4:17 a.m.

 Very detailed and well-documented article! Thanks for sharing. 

permanent link
Ruifeng Ma (1112) | answered Jan 08 '16, 3:39 a.m.
 Another possible way is to add RTC-Clicent-plainJavaLib as a shared library referenced by the application through WAS Admin Console.

1. Package the RTC java client library as a server scoped shared library
2. Make the shared library an isolated shared library by checking the "Use an isolated class loader for this shared library" checkbox in the Integrated Solutions console
3. Associate the shared library with the application or module

Some useful reference links

Creating shared libraries:

Associating shared libraries with applications or modules:

Your answer

Register or to post your answer.