The Lazy Dev

Do less. Develop more.  
Filed under

osgi

 

Joke of the day

What happened to me today.

The OSGi Manifest file generator tool suddenly started inserting a dot in the import package. A dot? A dot. Does not make sense, who tells him to do that?
This way the bundle won't start on the OSGi container. Why does this happen? All other 4 projects with the very exact same configuration work fine.

Two hours investigating the problem. In the end, I hacked the maven-bundle-plugin, discovered that is the underline tool, Bnd, that insert the dots, and hacked the maven-bundle-plugin to remove the dots.

In the meantime, I asked the question on twitter. http://twitter.com/#!/ildella/status/71189575145496576
@njbartlett answered me: "It can happen with classes produced by the Eclipse compiler that still have compile errors in them. "
http://twitter.com/#!/njbartlett/status/71192822333718528

Really? Really?
"It's because you drank a capuccino too late this morning".
"Hey, have you called your mom today? That's why it does not work"
"Look out, there's too much sun, so Bnd insert the dot".

These explanations to me make sense exacly like the one that has been provided by @njbartlett
The only difference is that he is right, that is exactly the problem that was affecting me.

But why? Why in the world this happen? And why specifically with Eclipse?
You can say it's easy, you just make the build compile. Yes, but it continue not to make sense.
And I still lost two precious hours dealing with some completely insane behavior.

That's bad.

Filed under  //   bnd   osgi  

Comments [2]

My top 5 OSGi unanswered questions

  1. how do I tell obr:deploy to ignore optional bundles?
  2. how do I change the layout of "osgi:list" and "obr:list" to display symbolicName instead of the (useless) bundle name?
  3. how do I instruct maven-bundle-plugin to create a war without the dependencies jars in the WEB-INF/lib folder?
  4. how do I configure Export-Package to export ALL the packages in the bundle BUT the packages that the bundles already imports from some other bundle
  5. why there are so few tutorial kind of documentation about OSGI?

Filed under  //   maven   obr   osgi  

Comments [0]

What's new in Karaf 2.2.0

Yesterday, February 28th 2011, Apache Karaf 2.2.0 OSGI container has
been released. It's a serious upgrade, the release notes say:

Some highlights include many new or updated commands, a LDAP JAAS module with login support, an updated feature service, a feature for Aries transaction, JPA & JNDI modules, expanded documentation, and new versions of most dependencies.

and here is a list of the most significative improvment I see:


Also we have some minor upgrade to Aries, Spring, Jetty, Pax and so on
and something like 50 bug fixes, here's the complete release notes,
find out what's relevant for you.
http://karaf.apache.org/index/community/download/karaf-2.2.0-release.html

Filed under  //   karaf   osgi   release  

Comments [0]

I got satisfaction (architectural solutions and cool technologies)

Very busy couple of weeks. I got over some new (for me) technologies that are actually pretty cool.

I got a lot of free degree of movement in the rejuvenation and restructuring of a software infrastructure that aims to deliver an ecommerce store for different countries.

The plan was to build a new message driven middleware based on ActiveMQ to manage the store orders distribution to some external system (like SAP). We need to have a lot of different small, very specific subject that are able to consume and manage the store orders in, ehm, order to manipulate them the most natural solution to me seem to run them in a OSGi container that allows to install, uninstall, upgrade, start and stop many different OSGI bundles (nothing more than simple jars with some meta information) in the easiest and fastest way.

So I got the change to play with Apache ActiveMQ to build the middleware and Apache Felix to have the OSGi container.
I got over both of them in less than two weeks, doing other tasks in the meantime.
Now I have a running Felix and I am able to produce a bundle that got activated once installed and started. This without changing my build tool chain, a simple "mvn install" is enough to produce the bundle, I just miss the way to deploy directly to the felix install.
And on theĀ  ActiveMQ side I can connect producer as well as subscribers to my queues or topics and my subscribers are able to reconnect and recover messages they lost when they were offline.

This solve all the first wave of technical challenges and put the basis for a nice infrastructure.

So I am satisfied and I deserve a present, let's go looking for that Android phone...

Filed under  //   activemq   architecture   felix   jms   osgi   solutions  

Comments [0]

OSGi: manually download bundles?!?

I just reached this statement in the Maven Handbook, chapter "Cooking with Maven and OSGi"

"After installing the Apache Felix Web Management console, you will need to install some of its prerequisites."

No one move! What what what? I am missing something. Please tell me I am missing something.
I do not want to believe that after years to make people move to Maven and embrace automatical dependency resolution and download, now with OSGi, the new frontier, I have to manually install jars into a bundle local directory launching something as ugly as:

<pre class="screen"><span><strong class="command">mvn pax:import-bundle \
 -DgroupId=org.apache.felix \
 -DartifactId=javax.servlet
 -Dversion=1.0.0</strong></span>

Come on, tell me this is not true. A bad dream. Please.
--
Daniele Dellafiore
http://danieledellafiore.net

Filed under  //   maven   osgi  

Comments [0]