It's all about the answers!

Ask a question

Setting Runtime Dependency in Eclipse Plugin Development


ADALARASU R S (335) | asked Dec 05 '12, 9:39 a.m.
edited Dec 05 '12, 1:33 p.m.
 Hi,

I m very new to Eclipse plugin development. I m trying to develop a plugin to extend some features of Rational Team Concert (RTC). I m trying to understand very basic concept here. Whenever we extend some functionality we are adding the corresponding plugin in Dependencies Tab and eventually it gets updated in Manifest.MF. After saving the file i can see the changes under the section Require-Bundle: of Manifest.MF. 

My question is - When i deploy the new plugin which i developed, how the runtime environment will be able to pick the plugin from the corresponding path in the file system though in Manifest.mf we just have require-bundle names.  ( I understand that during the development time we specify the Target Platform because of which we are able to add the dependent plugin in the Manifest.mf).

I m trying to understand is there any setting or config file in which we specify the path of the SDK or plugin repository when the server starts up. I searched in many sites but i didnt get any solution ( may be its a very basic)


Accepted answer


permanent link
sam detweiler (12.5k6195201) | answered Dec 05 '12, 12:22 p.m.
edited Dec 05 '12, 5:14 p.m.
ok, on the server side, you should be able to find each of those plugins in one of the server plugin directories
on my 3.0.1.1 server these are in one of these directories
 Directory of M:\rtc server 3.0.1.1\server\conf\ccm\sites
<p>
11/27/2012  10:32 PM    &lt;DIR&gt;          enterprise-update-site
11/27/2012  10:31 PM    &lt;DIR&gt;          rtc-commons-update-site
11/27/2012  10:31 PM    &lt;DIR&gt;          update-site
</p>
if not, then your sdk and server runtime are out of synch.
the eclipse plugin.xml dependency checker can help make sure at least you have the right info according to the eclipse Window->Preferences->Plugin Development->Target Platform selection.

my operation advisors install without problems like this.. the other thing you could do is to remove the version dependency from manifest.

here is one of my advisor manifest.mf file, note that no specific versions are required.

Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Enforce resolving dependencies
Bundle-SymbolicName: Save_Operation_Advisor;singleton:=true
Bundle-Version: 1.0.0.qualifier
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Require-Bundle: com.ibm.team.process.common,
 com.ibm.team.workitem.common,
 com.ibm.team.repository.common,
 com.ibm.team.repository.service
Import-Package: org.eclipse.core.runtime,
 org.osgi.framework
Bundle-ActivationPolicy: lazy
ADALARASU R S selected this answer as the correct answer

Comments
ADALARASU R S commented Dec 05 '12, 1:22 p.m.

Hi Sam, Thats a great explanation.  I agree that all the above plugin jars mentioned are available in one of the directories of RTC server 3.0.1.1\server\conf\ccm\sites. One last ques from the above explanation, you mentioned tht my SDK & Server runtime may out of sync.. But what if one of the plugin is missing,  How to sync the server runtime with SDK plugins ?

eg: lets say i need to use the following plugin dependencies - com.ibm.team.jface; com.ibm.team.workitem.ide.uicom.ibm.team.repository.client in one of the plugin customization, which is currently not part of Server runtime. But I know where the dependency jars are located in my file system. Where am i supposed to copy these jars in the server so that when the plugin looking for the above mentioned jars is loaded it will not through missing require bundle error.


1
sam detweiler commented Dec 05 '12, 1:35 p.m. | edited Dec 05 '12, 1:40 p.m.

you can NEVER EVER use a ____.client jar on the server.. you must find the equivalent function in some server SERVICE.jar (and you WILL have to change your code, as the server api parameters are usually different)

com.ibm.team.repository.service, com.ibm.team.workitem.service..

and just to be clear.. SDK means SERVER SIDE jars,
plain java means CLIENT SIDE jars.. you cannot mix.
IF you had CLIENT jars as part of the compile, then your plugin platform was set incorrectly.

com.ibm.team.workitem.ide.ui is also a client side only jar.

the libraries are split up (workitem for example)

1. com.ibm.team.workitem.client  -- client only
2. com.ibm.team.workitem.common --- either
3. com.ibm.team.workitem.service -- server only

client code can use 1 & 2
server code can use 2  & 3


ADALARASU R S commented Dec 05 '12, 2:00 p.m.

Thank you so much for the explanation Sam. I really appreciate the help. 

3 other answers



permanent link
sam detweiler (12.5k6195201) | answered Dec 05 '12, 9:58 a.m.
having JUST finished this very thing, you must INSTALL your new plugin, using an update Site

code plugin project<- feature plugin project <- update site plugin project (here is where the build happens, off the site.xml)

then, if you are replacing an IBM provided jar file, because the names are the same(specified in the source import, manifest,mf file, in my case 'Bundle-Version: 1.1.1.v20110524_1821', you have to manually copy your new jar file

in my case "com.ibm.team.feed.core_1.1.1.v20110524_1821.jar"
my update site contains 3 jar files after build complete

then, after install, and copy, you need to do an Eclipse - clean startup..(otherwise eclipse won't read the plugins folder for new files)

you should be able to test the code using a debug version of eclipse from the developer eclipse..
(I launch the 3.0.1.1 eclipse to test, from my 4.x eclipse development environment), the debug pass does a -clean by default



Comments
ADALARASU R S commented Dec 05 '12, 10:13 a.m. | edited Dec 05 '12, 10:14 a.m.

 Hi Sam, Thanks for the reply. Yes i did create a feature project and update site project. I added the plugin project in feature project and then i added the feature in the update site project. When i triggered the build using site.xml --> PDE tools --> Build Site, it generated just the plugin jar and feature jar and it didnt generate or copy any of the plugin jars which i added in the manifest.mf. Am i missing something here ? (the plugin which i m developing is for both web view of RTC and for eclipse version of RTC, which means i have to deploy that to the RTC Tomcat server and start the server)


permanent link
sam detweiler (12.5k6195201) | answered Dec 05 '12, 11:37 a.m.
edited Dec 05 '12, 11:42 a.m.
now that you have BUILT the code (jars) , you have to INSTALL in into eclipse

Help->Install New Software, Add, push Local, navigate to the location of site.xml in your development environment for the update site project.  give the entry a Name. press Save
then select the new 'site' in the dropdown, and make sure to deselect group by in the lower left
then select your Update site name. then follow the install button path.

if you are replacing one of the IBM distributed JAR files (like I do), then the install requires one extra step
as the install won't overlay same named files.. you have to do that manually.

then after all that, restart Eclipse with the -clean parameter to get it to re-read the plugins folder..

for Web there is a different process.. you have to deploy to the server\conf\ccm\sites folder and create a provisioning profile, then tell the server to reload plugins, and then restart the server so that it actually does this. (and to uninstall, its the same)..
I know there are documents on the jazz.net/library, but I don't know which one covers which topic anymore. (maybe Ralph will be along soon to help out here)

my client plugin talks to a new server service, so I have to do both.. and one of my prior exercises also had web javascript changes as well.


permanent link
ADALARASU R S (335) | answered Dec 05 '12, 12:03 p.m.
 Hi Sam, Thank you so much for the reply. I completely accept the solution which you provided above for a plugin which works in Eclipse IDE environment. 
But in my case what i m trying to do is to deploy a plugin in a server. For example i was trying to follow the example mentioned in the following link.  ( https://www.ibm.com/developerworks/mydeveloperworks/blogs/extendingrtc/entry/checksummaryadvisor?lang=en)  in which they are trying to extend the Extension point ( com.ibm.team.proccess.service.operationAdvisors). 
In this case, plugin will be deployed to a RTC Jazz server (tomcat server with OSGI). I developed the same example and deployed in my local server and when the plugin was starting, it just stopped in INSTALLED state because of missing bundles. Please find the following errors. But all the jars mentioned were part of RTC SDK, still when the plugin is deployed in server its not able to resolve it.

 Direct constraints which are unresolved:
    Missing required bundle com.ibm.team.process.common_1.2.1.
    Missing required bundle com.ibm.team.repository.common_1.1.1.
    Missing required bundle com.ibm.team.repository.service_1.1.1.
    Missing required bundle com.ibm.team.workitem.common_3.0.1.

Your answer


Register or 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.