A blog about my daily tech ramblings.

Showing posts with label Datasource. Show all posts
Showing posts with label Datasource. Show all posts

Friday, 2 August 2013

Injecting OSGi Service Registry in Spring Context

August 02, 2013 Posted by Unknown , , , 1 comment

Introduction

In this example we will inject a OSGi service registry inside a Spring Context.

OSGi Service Registry

Let's assume we got a Oracle datasource in our OSGi container with the following service description. (Please see this link)

Spring Configuration

1. Add the OSGi namespace in your Spring context.


2. Using the osgi:reference to get the datasource object.



Oracle Datasource in Fuse ESB / Apache Karaf

August 02, 2013 Posted by Unknown , , , , 1 comment
Creating a Oracle data-source in Fuse ESB [Apache Karaf]


1. Create a blueprint xml file as shown below -


datasource-oracle.xml




2. Installing the Oracle Driver in Karaf console

install -s wrap:mvn:com.oracle/ojdbc6/11.2.0

Note: Please make sure you've got the Oracle Driver in your local/remote maven repository. If you don't have it please install with the following maven command -

mvn install:install-file -Dfile=ojdbc6.jar -DgroupId=com.oracle \
    -DartifactId=ojdbc6 -Dversion=11.2.0 -Dpackaging=jar

2. Deploy it on the Fuse ESB server

Copy the datasource-oracle.xml in the FUSE ESB deploy folder ( e.g. %FUSE_SERVER%/deploy )