File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Other Application Frameworks and the fly likes OSGI working example Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Application Frameworks » Other Application Frameworks
Reply Bookmark "OSGI working example" Watch "OSGI working example" New topic
Author

OSGI working example

Suresh Khant
Ranch Hand

Joined: Feb 27, 2010
Posts: 100
Hi All,

I have started learning OSGI and I want working example for that(already tested )..

Anyone can help me ?

by the way I have tried several examples but I was unable to run them correctly.
Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2329
What, exactly, have you tried, and how, exactly, did that not work?

Also, which implementation are you using? Apache Felix, for example, has numerous examples readily available online: http://felix.apache.org/site/apache-felix-osgi-tutorial.html and http://felix.apache.org/site/apache-felix-application-demonstration.html
Suresh Khant
Ranch Hand

Joined: Feb 27, 2010
Posts: 100
Thanks Moores for your reply ,

I have tried this example http://www.javaworld.com/javaworld/jw-03-2008/jw-03-osgi1.html?page=2

and i have got this error

Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2329
If you're a beginner with OSGI I wouldn't start by mucking around with as complex an application as Eclipse. Start with a simple example instead that doesn't have any other external dependencies. The Felix examples I pointed you to accomplish that nicely.
Suresh Khant
Ranch Hand

Joined: Feb 27, 2010
Posts: 100
Thanks Moores for your reply,


I have did the following steps
1. create Activator.java file
2. generate the jar file "BundleExample1.jar"
3. start it using the command
start file:/home/test/Desktop/BundleExample1.jar

but am getting the following error






manifest.mf



Activator.java
Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2329
Looks like you're using an old JRE version. Recompile the sources with the JDK/JRE with which you intend to run them.
 
 
subject: OSGI working example
 
Threads others viewed
Portability of Spring applications running in OSGi and outside of OSGi
OSGi and Spring, is it worth it?
Calling Osgi service from Servlet
OSGi Use Cases
Modular Java: ESB
WebSphere development made easy
without the weight of IBM tools
http://www.myeclipseide.com