Can I run a standard OSGI bundle in equinox? - osgi

I have developed an OSGI bundle with Bndtools, and it can work well in Apache Felix. So can I publish the bundle and run it in Eclipse equinox directly?

You should be able to run your bundle in any OSGi framework that supports all requirements your bundle has. Typically felix and equinox can be swapped quite easily.
Did you get any errors?

Related

Using OrientDB in an OSGi environment

I'm trying to build an application that uses an embedded OrientDB (currently "memory:") graph database.
I'm using OrientDB 2.2
I am using Eclipse bndtools for my development environment.
I have added orientdb-core and orientdb-graphdb osgi bundles as build dependencies to my bundle, but on its own that isn't enough, I need access to the tinkerpop blueprint classes as well. There doesn't seem to be a tinkerpop blueprints osgi bundle that I can see.
I can include the blueprints-core jar as a build dependency, and that gets rid of the compile errors, but I then get into all sorts of issues trying to resolve the bundles so I can run something. (the primary error there that I don't seem to be able to get rid of is a complain about not being able to resolve "com.carrotsearch.hppc" -- I include that in my bundle, and export it, but still no joy there)
Shouldn't orientdb-graphdb either depend on a suitable bundle, or include and export the classes?
It sounds like you're running into the classic problem of wrapping a third-party, non-OSGi library as an OSGi bundle.
The best tutorial for this is on the EnRoute site. Note that you don't need to be using EnRoute for this tutorial to be relevant.

CICS Explorer bundle could not be resolved

I am working on a simple Java-DB2 insert program connected to cics region via CICS explorer. I created a plugin for an external jar(com.ibm.db2.jcc), exported the plugin as a deployable plugin and added this in the build path of the program. The package has also been added in the dependencies (import-package) of the program. But installing the bundle in the cics region, I am getting an exception.
The bundle ABC could not be resolved. Reason:Missing constraint:Import-package:com.ibm.db2.jcc;version="0.0.0".
Can someone help me trace the problem?
I'm assuming the program you're writing is in an OSGi bundle that's being deployed into a CICS JVM Server as your OSGi environment, using CICS's OSGi CICS bundle parts. It sounds like you're taking an existing binary dependency and rebundling it as an OSGi bundle, and want to have your program resolve it using OSGi.
Based on these assumptions, it sounds like you're having to add the bundle to your build path automatically, which I don't think you should have to do. Once you've set up your target platform (http://pic.dhe.ibm.com/infocenter/cicsts/v5r1/index.jsp?topic=%2Fcom.ibm.cics.ts.java.doc%2Ftopics%2Fdeveloping_sdk.html) any dependencies should then be resolved either from OSGi bundles in your workspace, or your target platform. It should then just be a case of adding an OSGi bundle part for each of your bundles, and exporting your CICS bundle to your region. Explorer should take care of exporting all of your relevant dependencies to CICS.
If you wanted, it should be possible to add the DB2 jar file as a lib without rebundling as an OSGi bundle, by adding the library to your Bundle-Classpath manifest declaration, but you might already have considered this!

Enabling/Disabling specific OSGi bundles of clusters in Netbeans Platform Application

We are developing a Netbeans RCP application that includes NB modules, and OSGi modules. Focus of the problem is within the OSGi bundles. So I will explain about the details with the OSGi bundles.
In this RCP application, OSGi bundles are formed as Netbeans clusters. And these clusters are included in Netbeans Platform application. Everything is okay until now. We can run OSGi bundles in Netbeans platform app with success.
But, when we try to untick a specific OSGi bundle in included cluster( in Netbeans Platform App project ), Netbeans platform application does not simply turns off the OSGi module. It still continues to load it with application.
When the same action is done with a Netbeans module(not an OSGi module), this problem does not occur, simply module is disabled and unloaded.
Netbeans version is 7.3.1, we have tried cleaning cache, suite build etc.. But no success. I have to mention also that OSGi declarative services are used( one of the possible suspects also )
Is there any way to specialize which OSGi modules in a cluster will be included in main Netbeans Platform Application ?
Thanks...
This sounds like a bug to me. You should report it here, a small test case should speed up the bug report.

OSGI Apache felix- Hot deployment support

A little back ground: We are using Apache Felix implementation of OSGI for our web development (Adobe CQ5 which inturn is built on apache felix). We have a few bundles of our own (around 10) and each of them are configured as a project.
Issue: During the development lifecycle, we make changes to a bundle and then use an ant script to create the bundle and deploy it in the felix. I am wondering if there is some way to enable hot deployment of the changes I make during development mode that would save developers time.
Based on my research, we can use the felix file install which will monitor a folder(s) for changes to any bundles and can deploy them automatically. But this again means I need to run ant script to build the jar file and move it to the auto deploy folder the file install is watching. Is there a better/fast way to achieve this? The script is currently taking a around 10 seconds (approx) to compile the classes, create osgi specific meta data files, bundle the classes+metadata in a new jar. Is there some way to do hot deployment, so that any change I make to a java file is automatically reflected in the bundle?
Many thanks
If you develop your project in Bndtools, and run from the built-in launcher, then Bndtools will handle immediately building any Java code that you change, and deploying the updated bundle into the runtime. This leads to an extremely quick code/test/debug/fix cycle.
Having said that, I'm amazed that it takes 10 seconds to compile and build your bundles currently! Are you building on an extremely ancient computer? Or is the bundle multiple gigabytes in size?
We tried DCEVM and it does almost everything we expected to reduce the develop+fix+test life cycle. I recommend this to all java developers using big web applications. Thanks for your suggestion on bndtools Neil.

Run nutch in OSGI environment

I am new to OSGI framwork So this question might seem silly.
Can we run Apache Nutch 1.4 in OSGI framework. I want to create an OSGI bundle of nutch. I am using eclipse indigo to compile the Nutch source code. So i think there should be some kind of plugin which can create OSGI bundle instead of jar after the compilation. I just need the OSGI bundle of Nutch.
I don't even know if it is possible.
You need to look for a bundle that implements Nutch. A quick google turned up this. If this particular bundle doesn't meet your needs, you can just embed the Nutch dependency into one of your own bundles, using the Embed-Dependency field in your bundle's manifest.
A bundle which already implements Nutch, as the other answer suggests, is your best bet. More generally, you can easily convert an existing jar into an OSGi bundle (without having the source code) using the wrap function of the bnd tool. If you do have the source code and want to recompile, maven's bundle plugin and the bundle packaging will generate bundles.
In the interests of modularity, which is one of OSGi's main drivers, I'd suggest using a separate Nutch bundle rather than embedding the dependency.

Resources