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

Plugin or Jar for Java Program to connect to RTC server

Hi All,

I am struglling to connect to a RTC server with Java program.

Have added several jars but still getting below error.

Seems Jar compatibility issues.

If you can guide me ahead or tell me appropriate Jars or Plugin that can be used  to connect to RTC server would be very helpful.

Thanks in advance!

ERROR---

Apr 30, 2014 7:06:56 PM com.ibm.team.repository.common.internal.util.StandaloneAdapterRegistry loadFactory

SEVERE: java.lang.NoClassDefFoundError: com/ibm/team/foundation/common/internal/util/ExceptionDescription

Apr 30, 2014 7:06:56 PM com.ibm.team.repository.common.util.ExtensionReader logError

WARNING: Plugin com.ibm.team.workitem.common, extension org.eclipse.core.runtime.adapters

Error processing extension: org.eclipse.core.internal.registry.ConfigurationElementHandle@1f0

Apr 30, 2014 7:06:56 PM com.ibm.team.repository.common.internal.util.StandaloneAdapterRegistry loadFactory

SEVERE: java.lang.NoClassDefFoundError: Could not initialize class com.ibm.team.workitem.common.internal.WorkItemExceptionDescriptionFactory

Apr 30, 2014 7:06:56 PM com.ibm.team.repository.common.util.ExtensionReader logError

WARNING: Plugin com.ibm.team.workitem.common, extension org.eclipse.core.runtime.adapters

Error processing extension: org.eclipse.core.internal.registry.ConfigurationElementHandle@1f2

Apr 30, 2014 7:06:56 PM com.ibm.team.repository.common.internal.util.StandaloneAdapterRegistry loadFactory

SEVERE: java.lang.NoClassDefFoundError: Could not initialize class com.ibm.team.workitem.common.internal.WorkItemExceptionDescriptionFactory

Apr 30, 2014 7:06:56 PM com.ibm.team.repository.common.util.ExtensionReader logError

WARNING: Plugin com.ibm.team.workitem.common, extension org.eclipse.core.runtime.adapters

Error processing extension: org.eclipse.core.internal.registry.ConfigurationElementHandle@1f4

Exception in thread "main" java.lang.ExceptionInInitializerError

at com.ibm.team.repository.client.TeamPlatform.getTeamRepositoryService(TeamPlatform.java:126)

at com.example.unixdemo.RtcConnDemo.main(RtcConnDemo.java:31)

Caused by: java.lang.SecurityException: class "org.eclipse.core.runtime.Platform"'s signer information does not match signer information of other classes in the same package

at java.lang.ClassLoader.checkCerts(ClassLoader.java:807)

at java.lang.ClassLoader.preDefineClass(ClassLoader.java:488)

at java.lang.ClassLoader.defineClassCond(ClassLoader.java:626)

at java.lang.ClassLoader.defineClass(ClassLoader.java:616)

at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)

at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)

at java.net.URLClassLoader.access$000(URLClassLoader.java:58)

at java.net.URLClassLoader$1.run(URLClassLoader.java:197)

at java.security.AccessController.doPrivileged(Native Method)

at java.net.URLClassLoader.findClass(URLClassLoader.java:190)

at java.lang.ClassLoader.loadClass(ClassLoader.java:307)

at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)

at java.lang.ClassLoader.loadClass(ClassLoader.java:248)

at com.ibm.team.repository.client.internal.TeamRepositoryService.shouldAllowJtsLogin(TeamRepositoryService.java:78)

at com.ibm.team.repository.client.internal.TeamRepositoryService.<clinit>(TeamRepositoryService.java:64)

... 2 more


0 votes

Comments

are u doing this from Eclipse, or the commandline?

there are a lot of jar files involved with the Java api.
the best is to specifiy the -classpath path_to_plainjava_jars/ *

with the trailing slash to denote directory;

if using eclipse, make a user library (in the build path) pointing to that folder.
(add Library)

Thanks for the reply Sam.

I downloaded RTC-Client-plainJavaLib-API-javadoc-4.0 but cant find Jars into it.
Can you please tell me where would i find plainjava_jars?

There are two downloads in:
https://jazz.net/downloads/rational-team-concert/releases/4.0.6?p=allDownloads
, likely you got only the second one, but you need both:


Plain Java Client Libraries

Plain Java Client Libraries API documentation

Lara, i have downloaded both.

but cant see jars in any of the folders.


Accepted answer

Permanent link
The Plain Java Client Libraries file should have the Jar's. E.g. RTC-Client-plainJavaLib-4.0.6.zip looks like follows:



What do you see if you open it?

For calling a Plain Java Client Libraries program see http://rsjazz.wordpress.com/2013/03/20/understanding-and-using-the-rtc-java-client-api/
Manish Ranglani selected this answer as the correct answer

0 votes

Comments

Thanks Ralph,

Downloaded the correct version.

Code: ITeamRepository repo = TeamPlatform.getTeamRepositoryService().getTeamRepository(repoUri);

repo.registerLoginHandler(new ILoginHandler2() {

@Override


public ILoginInfo2 challenge(ITeamRepository repo) {

return new UsernameAndPasswordLoginInfo(userId, password);

}

});

repo.login(myProgressMonitor);

repo.logout();

Output:

May 5, 2014 3:30:17 PM org.apache.commons.httpclient.HttpMethodDirector isAuthenticationNeeded

INFO: Authentication requested but doAuthentication is disabled

I need to login to server and query stream,

Can you please advise?

Please have a look at my blog as suggested above. There is a lot of example code you can use. You can search the blog as well. Start here: http://rsjazz.wordpress.com/2013/02/28/setting-up-rational-team-concert-for-api-development/

http://rsjazz.wordpress.com/2013/09/24/managing-workspaces-streams-and-components-using-the-plain-java-client-libraries/ talks about streams.

Hi Ralph,

I follwed the setting-up-RTC link.

After the setup when i try to run snippet1 below is the error:

Exception in thread "main" java.lang.SecurityException: class "org.eclipse.core.runtime.IExtension"'s signer information does not match signer information of other classes in the same package

Is it some jar compatiblity issue?

I haven't seen that error. Not sure. How do you call the snippet? Inside Eclipse?

Yes, ran it as a java application.

Not sure what it is. One hint, you need a JDK with the Plain Java Client Libraries. You can try it out inside Eclipse and use the JDK shipped with it (calling the main() not using a batch), or point to the JDK that ships with it. Otherwise, I haven't seen this error, so not sure what it could be.

Hi Ralph, This happens when classes belonging to the same package are loaded from different JAR files, and those JAR files have signatures signed with different certificates.

I had removed org.eclipse.core.runtime from Manifest.MF.

Executing Snippet shows:

May 6, 2014 11:57:54 AM com.ibm.team.repository.common.util.ExtensionRegistryReader logError SEVERE: The com.ibm.team.repository.common bundle's plugin.xml file contains a <component> element with the id attribute value com.ibm.team.links that is not unique. Contacting https://jtsrv.uk.hibm.hsbc:9092/jazz/... May 6, 2014 11:57:56 AM org.apache.commons.httpclient.HttpMethodDirector isAuthenticationNeeded INFO: Authentication requested but doAuthentication is disabled May 6, 2014 11:57:58 AM org.apache.commons.httpclient.HttpMethodDirector isAuthenticationNeeded INFO: Authentication requested but doAuthentication is disabled May 6, 2014 11:58:00 AM org.apache.commons.httpclient.HttpMethodDirector isAuthenticationNeeded INFO: Authentication requested but doAuthentication is disabled Unable to login: CRJAZ0124I Invalid username or password.

I am unable to see the last two comments in the forum. I have not seen this, and I can't reproduce the issue. Which version are you using?

I would also be concerned about the "CRJAZ0124I Invalid username or password"

Security Exception was because of class being referred from multiple jars. So removed org.eclipse.core from MANIFEST.MF as it exists in plain java_jars.

showing 5 of 10 show 5 more comments

One other answer

Permanent link
If you want to write standalone Java, use the RTC Plain Java API's. Refer RTC Download section and look for Plain java api

If you want to write Participant or advisor you need server side API's. Refer https://jazz.net/library/article/1000 for examples.

Alternatively you can also use OSLC REST API to talk to RTC via any programming language. Refer https://jazz.net/library/article/635

1 vote

Comments

Thanks for the reply Karthik,

i have downloaded

Plain Java Client Libraries
Plain Java Client Libraries API documentation

cant find jars in them.

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,937

Question asked: Apr 30 '14, 11:20 a.m.

Question was seen: 8,292 times

Last updated: May 06 '14, 7:17 a.m.

Confirmation Cancel Confirm