It's all about the answers!

Ask a question

RTC Extending, Runnable Jar (getClientLibrary returns null)


nhelldorff (153) | asked Jul 13 '16, 7:30 a.m.
 Hello,
I want to create from my project which manages absences a runnable jar, I am using the Plain Java Api and a absences API from rsjazz, but everytime I try to run the program, a NullPointerException occurs because the method getClientLibrary(IResourcePlanning.class) returns null, what can I do against it, in order to run my program successfully,

Thanks in advance.

Nicolai Helldorff

Accepted answer


permanent link
Ralph Schoon (59.4k23642) | answered Jul 13 '16, 8:33 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Because the package is com.ibm.team.apt.internal.client.resource IResourcePlanningClient is therefore part of the agile planning internal API. This is only shipped with the RTC Eclipse client SDK and not with the Plain Java Client Libraries. You would have to find the jar that contains it and add it to the classpath.
selected this answer as the correct answer

Comments
nhelldorff commented Jul 13 '16, 8:41 a.m.

 I found the jar but and added it "as external jar" but it still doesn't work 

FileName: com.ibm.team.apt.client_3.0.1400.v20151219_0057.jar


Ralph Schoon commented Jul 13 '16, 8:55 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

This is not API related, these are simple Java questions. Adding it as an external JAR does only make sense in Eclipse. Outside of Eclipse the JAR file needs to be available in the classpath. Consider to search Stackoverflow.com for basic Java Questions.


nhelldorff commented Jul 13 '16, 9:25 a.m.

Thank you :)

I was despairing on this task ^^
Have a nice day

One other answer



permanent link
Ralph Schoon (59.4k23642) | answered Jul 13 '16, 7:44 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
edited Jul 13 '16, 7:45 a.m.
The call is
final IResourcePlanningClient resourcePlanning = (IResourcePlanningClient) teamRepository.getClientLibrary(IResourcePlanningClient.class);

IResourcePlanning.class does not exist or is no client library.

Comments
Ralph Schoon commented Jul 13 '16, 7:46 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

In the code i have here, this works. Make sure to test that in debug mode. I have also answered on your other question with respect to the jar file.


nhelldorff commented Jul 13 '16, 7:51 a.m. | edited Jul 13 '16, 7:52 a.m.

I haven't changed your code, it is as you wrote in the program, I just described it badly in the question. 

My problem is, that if I try to execute the runnable jar file from a batch script, the Method getClientLibrary returns null, if i execute it in Rational Team Concert everything works fine.
So my question is what can I do against it that the method getClientLibrary does not return null.
I want to let the jar run as standalone


nhelldorff commented Jul 13 '16, 8:21 a.m. | edited Jul 13 '16, 8:32 a.m.

 From this jar file I can access ITeamBuildClient but not IResourcePlanningClient


ITeamBuildClient buildClient = (ITeamBuildClient) sec.getRepository().getClientLibrary(ITeamBuildClient.class); // works
IResourcePlanningClient plan = (IResourcePlanningClient) sec.getRepository().getClientLibrary(IResourcePlanningClient.class); // returns null


Ralph Schoon commented Jul 13 '16, 8:34 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

As an administrator and moderator I can decide to remove buttons from other people posts or to ban users that create buttons and remove them from the forum entirely 8).


nhelldorff commented Jul 13 '16, 10:51 a.m. | edited Jul 13 '16, 10:52 a.m.

But what, if I need a button or a progess bar to express my problems with the java basics? ;)


Ralph Schoon commented Jul 13 '16, 11:01 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

You've been warned 8P. You too!

showing 5 of 6 show 1 more comments

Your answer


Register or to post your answer.