Monday, September 30, 2013

JDK8 and Lambda

Well, I am a big fan of Groovy for its simplicity and the way it brings productivity.

I was amazed when I learnt on how fast I could process a file using a single line of code.

Above that, I am a big fan of James Strachan's works. Be it Camel / Groovy, this man knows common man's difficulties and yet had the thing to implement and prophecise  EIPs.

The versatility that he brings with Camel as a simple integration framework with DSL is appreciative.
The testing framework that is included and how easy it is to debug and use them for quick validations is impressive along with OSGi enablement.

A nice article on his praise for OOTB thinking and the way it influenced the Java community to include Lambda is cited here.

Wednesday, September 11, 2013

Karaf - WOW!!! What a container. Amazing OSGi

I am planning to write a detailed blog on my new trails with Karaf, specifically 2.3.0.

I will keep posting the the issues, I faced and finding the solutions / approaches for the same.

Issue-1 (not really one ;) )
JBossFuse:karaf@root> install -s mvn:com.dix.rest.services/PureBundle/1.0.0-SNAPSHOT
Bundle ID: 252
Error executing command: Error installing bundles:
        Unable to start bundle mvn:com.dix.rest.services/PureBundle/1.0.0-SNAPSHOT: Unresolved constraint in bundle PureBundle [252]: Unable to resolve 252.0: missing req
uirement [252.0] osgi.wiring.package; (&(osgi.wiring.package=javax.ws.rs)(version>=2.0.0)(!(version>=3.0.0)))

Simple, way to solve this is to provide some package resolution within your pom.xml

example for this case of javax.ws.rs version wiring issues,

I used

<import-package>
javax.ws.rs.*;version="[1.1,3)",
org.apache.cxf.*;version="[2,4)",
*
</import-package>

This solved the issue. What happens here is that, the OSGi container's DI (Aries) looks to proxy my service definitions and couldn't understand as there were many versions / exports available from the already deployed bundles.

Hence, OSGi bundle plugin within your pom should have these import specs specified explicitly along with the versions you can adapt / accept.