Sunday, 11 August 2013

Issue when trying to export spring bean as OSGI service

Issue when trying to export spring bean as OSGI service

I wanted to export a bean as a OSGi service , so that this can be used in
another bundle. But I get the below error. Please help.
SEVERE: Unable to create application context for [com.abc.test.impl],
unsatisfied dependencies: Dependency on
[(objectClass=com.abc.platform.test.manager.ITestManager)] (from bean
[&testManager]) org.springframework.context.ApplicationContextException:
Application context initialization for 'com.xyz.test.impl' has timed out
waiting for (objectClass=com.abc.test.manager.ITestManager)
The code is given below.
Bundle 1 (com.abc.test.impl) : Bean declaration -
<bean id="testManagerTarget" class="com.abc.platform.test.TestManager">
<property name="sessionFactory" ref="sessionFactory"/>
</bean>
<bean id="testManager"
class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
<property name="transactionManager">
<ref bean="transactionManager" />
</property>
<property name="target">
<ref bean="testManagerTarget" />
</property>
<property name="transactionAttributes">
<props>
<prop key="store">PROPAGATION_REQUIRED</prop>
</props>
</property>
</bean>
Declaring bean as OSGI service -
Text content in the code blocks is automatically word-wrapped
<osgi:service id="testManagerService" ref="testManager"
interface="com.abc.platform.test.manager.ITestManager" />
Bundle 2 (com.xyz.test.impl):
<osgi:reference id="testManager"
interface="com.abc.platform.test.manager.ITestManager" />
Really appreciate any help.
Thanks Soniya

No comments:

Post a Comment