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

Add Absences to users using Client APIs as web-service

  Hi All, 

I want to add absences to all users in RTC through Server APIs but these are not available So I have to use Client APIs for this task by following this link to run at back-end as service when file uploads through web-page: 
https://rsjazz.wordpress.com/2014/07/22/manage-scheduled-absences-using-the-plainjava-client-libraries/ 

For making Java Restful Webservice I convert this client extension which provided in the above link into Dynamic Web project and successfully created the service but then issue comes: 

Caused by: java.lang.ClassNotFoundException: com.ibm.team.apt.common.resource.IContributorAbsence 

Which i think the API of RTC SDK and that provided client extension will run without any issue if I run it as Java Applictation because target platform is RTC and it loads the APIs at runtime but not as a Service at compile time. 

Any Help is highly appreciated 

2

0 votes


Accepted answer

Permanent link
The Plain Java Client Libraries are contained in a zip file you can download as described in the Extensions workshop.
You have to package these libraries (JAR files) with your application and add them to the ClassPath, so they can be loaded by the class loader.
Farhan Habib selected this answer as the correct answer

0 votes

Comments

 Thanks Ralph for your quick response

Actually issue is not with the Plain Java Libraries, these loads fine but this exception:
Caused by: java.lang.ClassNotFoundException: com.ibm.team.apt.common.resource.IContributorAbsence

related to some API which exists in RTC sdk, not in Plain Java Libraries.
How can I load RTC Sdk at compile time while running web-service


Since there is no public API for planning and the interface is packaged with the agile planning component (.apt.) the jar file is not shipped with the plain Java Client libraries and you have to search the file com.ibm.team.apt.common*.jar in the Eclipse Plugins folder. If you use Installation manager to install RTC Eclipse, it might be in the installation manager shared folder.

You basically add that jar file to the other jar files you are using.

 Thanks Ralph for your guidence, feeling honored while discussing with you

I just found the jars in Plug-in dependencies folder, So now I move forward to add those in class path as well
I will put the solution here If I able to complete my task

Thanks for finding this, I updated the blog post.

 Task completed

These two jars were available in Plug-in dependencies:
- com.ibm.team.apt.client_3.0.1100.v20141011_0139.jar
- com.ibm.team.apt.common_3.0.1200.v20141011_0139.jar

which needs to be added in classpath

You needed both? Thanks for letting us know.

Yes because these are the packages that were used in ScheduleAbsence Client Extension as you know:

com.ibm.team.apt.common.resource.IContributorAbsence;
com.ibm.team.apt.common.resource.IContributorAbsenceHandle;
com.ibm.team.apt.internal.client.resource.IContributorInfo;
com.ibm.team.apt.internal.client.resource.IResourcePlanningClient;
com.ibm.team.apt.internal.common.resource.model.ContributorAbsence;
com.ibm.team.apt.internal.common.util.ItemCollection;

and these needed both jars

Good to know. Thank you very much!

I added that to the blog post as well.

I ran the tool from within Eclipse. These days I often also run it from outside, where it becomes apparent. Back then, I did not really have the time and also hadn't developed a good way for a standardized command line batch.

showing 5 of 9 show 4 more comments

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

Question asked: Jan 28 '16, 2:06 a.m.

Question was seen: 2,463 times

Last updated: Jan 28 '16, 8:46 a.m.

Confirmation Cancel Confirm