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.
ReplyDelete@Sachin: i have followed the above steps to inject osgi service jndi datasource to the jdbcTemplate, but i am getting the nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [org.springframework.jdbc.core.JdbcTemplate] found for dependency. what could be the issue?
my spring config is as below
osgi:reference id="dataSource" interface="javax.sql.DataSource" filter="(osgi.jndi.service.name=jdbc/mydb)" />