java - Cannot export Interface in OSGI -
i trying export interface (itestrunable) sure have linked correctly in context.xml , osgi.xml files wont work. error is:
application context initialization 'me.overlaymanagement' has timed out waiting (objectclass=me.overlaymanagement.testing.itestrunable)
any got idea?
code: spring files itestrunable
context.xml
<bean id="testingrunable" class="me.overlaymanagement.testing.testing" init-method="startup" destroy-method="shutdown"> </bean>
osgi.xml
<osgi:service id="testingrunable" ref="testingrunable"> <osgi:interfaces> <value>me.overlaymanagement.testing.itestrunable</value> </osgi:interfaces> </osgi:service>
spring files import main system
context.xml
<bean id="overlaymanagementsystem" class="me.overlaymanagementsystem.overlaymanagementsystem" init-method="startup" destroy-method="shutdown"> <property name="testingrunable" ref="testingrunable"/> </bean>
osgi.xml
<osgi:reference id="testingrunable" cardinality="1..1" interface="me.overlaymanagement.testing.itestrunable"> </osgi:reference>
gettors , settors itestrunable within main system
public class overlaymanagementsystem{ ... protected itestrunable testingrunable; .... public itestrunable gettestrunable() { return testingrunable; } public void settestrunable(itestrunable testingrunable) { this.testingrunable = testingrunable; } }
can see problem?
ok managed find poblem. 2 things actually:
it didnt had set bean id , service id itestrunable code located. once changed service id name different gave me new error invalid gettors , settors, next point.
after research found gettor , setter imported service must same beans property name service. notice in bean its:
< property name="testingrunable" .../>
and get/set defined as: "gettestrunable/settestrunable". changing these gettestingrunable , settestingrunable solved problem me.
i hope helps others.
Comments
Post a Comment