Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » OSGI Bundle use in a view
OSGI Bundle use in a view [message #104969] Mon, 11 February 2008 16:15
Tom Cx is currently offline Tom CxFriend
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
Previous Topic:OSGI Bundle use in a view
Next Topic:Where is my Application?
Goto Forum:
  


Current Time: Thu Dec 26 14:18:24 GMT 2024

Powered by FUDForum. Page generated in 0.03518 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top