Wednesday, April 27, 2016

Carbon JNDI

WSO2 Carbon provides an in-memory JNDI InitialContext implementation. This is available from the WSO2 Carbon 5.0.0. This module also provides and implementation of the OSGi JNDI services specification. You can find brief introductions and how to guides in the following sections. Source code is available in here. https://github.com/wso2/carbon-jndi

You can read more from the this article on medium

Saturday, March 5, 2016

How to create a new git repository from a directory in another git repository?

How to create a new git repository(B) from a directory and all it’s history in another git repository(A)?

Here are the steps.


git clone <repository-A-url>
cd <repository-A-dir>
git checkout <branch-in-repository-A>
git remote rm origin
git filter-branch --subdirectory-filter <directory-to-move> -- --all


git clone <repository-B-url>
cd <repository-B-dir>
git remote add orign-repo-a <repository-A-dir>
git pull orign-repo-a <branch-in-repository-A>
git remote rm orign-repo-a

Friday, February 26, 2016

Maven Archetype for Creating OSGi Bundles

Execute the following command to create an OSGi bundle.

mvn archetype:generate -DarchetypeGroupId=org.wso2.carbon -DarchetypeArtifactId=org.wso2.carbon.archetypes.bundle -DarchetypeVersion=5.0.0  -DgroupId=org.sample.asm -DartifactId=sample-asm -Dversion=1.0.0 -Dpackage=org.sample.asm

You can specify the groupId, artifactId and the version, but modifying relevant parameters.

You'll see the following directory structure and files once the project creations is completed.

Directory Structure

Tuesday, January 22, 2013

Demystifying OSGi

For the January Colombo Java meetup, Pradeep Fernando and Myself are doing a talk on OSGi. OSGi is a widely accepted standard for building dynamic modular systems on Java.  Now a days many of the IDEs, Web application servers are built using OSGi technology and this rate of adoption of OSGi is still growing.

If you haven't exposed to OSGi that much, come and join us for this months meetup. We will try our best to demystify OSGi. See you all there.

Topic: Demystifying OSGi
Date: 24th Jan 2013
Venue: WSO2(58 building), 58 Dharmapala Mawatha, Colombo 07 (map)




Friday, November 2, 2012

MacBook Pro: Mini Display Port to HDMI Issue

Very recently I've faced an issue while trying to connect my MacBook Pro with the TV.  I used a mini display port to HDMI adaptor and a 1.8m long HDMI cable. I connected the adaptor with the cable and plugged one end of the HDMI cable to the TV. Then I plugged the mini display port with MacBook hoping things would work perfectly.

And.. It didn't work. Tv did not display anything. But I could see a blue color screen in the laptop which lasted only few seconds.  Tried couple of times but with no success. Then I've search on forums a little bit and found out this strange solution.


  • Decouple the adaptor from the HDMI cable.
  • Plug one end of the  HDMI cable with the TV.
  • Plug mini display port to your MacBook Pro.
  • Turn on your TV.
  • Now connect HDMI adaptor with the HDMI cable.


Hmmm... It worked for me. 

Wednesday, October 5, 2011

Steve Jobs



He made the world a better place for us with his immense passion and innovation. He is an inspiring speaker. The world learnt a lot from him.

Saturday, May 21, 2011

3 years at WSO2

I joined WSO2 on May 21st, 2008 as a Software Engineer and now I am a three years old employee in the company working as a Technical Lead. Looking back joining WSO2 is one of the best decisions I've ever taken. I was just a fresh graduate when I join the company and this is my first job. People say that your first job should be a very challenging, exciting and hard working. Why? because then only you put the theories you learn in the university into practice and learn well and it lays a strong foundation for the rest of your career.

WSO2, being a innovative technology company, we always get opportunities to work with new technologies / new trends in the software industry. And also being an open source company, it helps employees to build their own identity in the Software field.

During these three years, I have worked on several projects. I was part of the WSO2 Carbon platform team from the day one. WSO2 Carbon was completely a new project at that time and I was lucky enough to engage with each and every aspect of this project. I still can remember those late nights we spent in WSO2 during the first release of Carbon. We faced many challenging issues during the initial days of Carbon and most of these are due to the adoption of OSGi. But these issues helped us to learn and be experts in OSGi. Even though we had a tough time working on Carbon, finally we did it.

After the first release of Carbon, we did many other major and minor releases. Gradually Carbon became a stable componentize platform for building enterprise middleware. Now We have many other products based on Carbon. Eventually I could become the product manager of the WSO2 Carbon platform. :)

Thereafter I got the opportunity to work with the Stratos team. I was handling the load balancing and auto scaling tasks.

Last but not least, I would like thank everyone who has helped me during these three years in WSO2.