It's all about the answers!

Ask a question

Plugin or Jar for Java Program to connect to RTC server


Manish Ranglani (835) | asked Apr 30 '14, 11:20 a.m.
edited May 05 '14, 4:48 a.m. by Ralph Schoon (60.5k33643)

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



Comments
sam detweiler commented Apr 30 '14, 11:26 a.m. | edited Apr 30 '14, 11:27 a.m.

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)


Manish Ranglani commented May 02 '14, 4:07 a.m.

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?


Lara Ziosi commented May 02 '14, 4:16 a.m.
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

Manish Ranglani commented May 05 '14, 3:18 a.m.

Lara, i have downloaded both.

but cant see jars in any of the folders.

Accepted answer


permanent link
Ralph Schoon (60.5k33643) | answered May 05 '14, 4:47 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
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

Comments
Manish Ranglani commented May 05 '14, 6:05 a.m.

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?


Ralph Schoon commented May 05 '14, 6:27 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

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.


Manish Ranglani commented May 05 '14, 8:03 a.m.

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?


Ralph Schoon commented May 05 '14, 8:11 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

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


Manish Ranglani commented May 05 '14, 8:15 a.m.

Yes, ran it as a java application.


Ralph Schoon commented May 05 '14, 9:19 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

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.


Manish Ranglani commented May 06 '14, 2:31 a.m.

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.


Ralph Schoon commented May 06 '14, 2:57 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

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?


Ralph Schoon commented May 06 '14, 2:58 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

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


Manish Ranglani commented May 06 '14, 7:17 a.m.

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
Karthik Krishnan (8594100149) | answered Apr 30 '14, 11:28 a.m.
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

Comments
Manish Ranglani commented May 05 '14, 3:21 a.m.

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 to post your answer.