devsda
devsda

Reputation: 4232

How to activate OSGI bundle?

I am working in Adobe CQ5. I made my project that contains only implementation, and the project title is Web Crawler.

And that project is started by one class that simply adds initial seeds.

I made OSGI bundle of my project and I deploy that also.

Now my question is how can I start my bundle, i.e, how can I add seeds ?

For that I read this link that tells me to make Activator class and put your function in the start method. I done the same. But that does not helps me to run the bundle.

Please help me how can I run the given bundle.

Edit No. 1

Can you tell me how can I make MANIFEST.MF file given in given tutorial ?

Upvotes: 0

Views: 1554

Answers (2)

Peter Kriens
Peter Kriens

Reputation: 15372

Look at the bndtools tutorial which is the easiest way to get you started with OSGi

bndtools is a user friendly tool based on Eclipse. With bndtools, you won't get lost in plugin hell. bndtools will also help you avoid BundleActivators since they were not such a good idea, Declarative Services is what OSGi should have been from day one. It also allows you to test the bundles without having to restart.

Upvotes: 3

santiagozky
santiagozky

Reputation: 2539

to create the manifest, if you are using maven (you should) you can use the maven bundle plugin. It will automatically generate a manifest file for you.

Then, to deploy and start your bundle you can use the maven-sling-plugin, which can deploy your bundles into sling.

If you want to manually activate your bundle, CQ5 provides a web based osgi console. you can activate it there. If it fails, there is probably an error in the start method of the activator class.

Upvotes: 2

Related Questions