OSGI Bundle use in a view [message #104969] |
Mon, 11 February 2008 16:15 |
Tom Cx Messages: 13 Registered: July 2009 |
Junior Member |
|
|
I have a bundle com.tcrscorner.ibs.generations.model.jar
which contains an interface save action and registers
a service in it's activator.
In my view plugin i added a reference to an external plugin which is in
fact the bundle:
I have the following code in the Activator of my view:
FileInputStream fis;
fis = new FileInputStream
(new
File(" c:/temp/generations/eclipse/plugins/com.tcrscorner.ibs.gener ations.model.jar "));
Bundle bundle = context.installBundle("GenerationsInterface", fis);
bundle.start();
This works fine cause when i execute "services" in the osgi console i get:
{com.tcrscorner.ibs.generations.model.SaveAction}={type=xml, service.id=34}
Registered by bundle: GenerationsInterface [26]
No bundles using service.
I have the following code behind a button on my view
String target = "com.tcrscorner.ibs.generations.model.SaveAction";
BundleContext context =
com.tcrscorner.ibs.generations.ui.Activator.bdContext;
Final ServiceTracker saveTrack = new ServiceTracker(context,
SaveAction.class.getName(), null);
saveTrack.open();
SaveAction saveXML = (SaveAction) saveTrack.getService();
if(saveXML != null) {
System.out.println("Test");
}
It's in this part of the code i get in trouble when exexcuting the code
above i get the following error: java.lang.NoClassDefFoundError:
com/tcrscorner/ibs/generations/model/SaveAction
I tried several things such as adding the import-package statement to
the manifest.mf of the view with the value :
com.tcrscorner.ibs.generations.model
However when running this i get immediately an error:
!MESSAGE Missing imported package
com.tcrscorner.ibs.generations.model_0.0.0.
This error could be resolved by placing the import-package optional.
However still no result
Any idea what the problem could be? How can I fit this all together so
that it works
Tnx in advance for the help !
Regards,
Tom
|
|
|
Powered by
FUDForum. Page generated in 0.03518 seconds