1 Attachment(s)
Accessing the Service from Slice WAR
I am facing another issue with Slices.
/WEB-INF/applicationContext.xml (which has Spring-DM’s <reference ... />) is not getting loaded even after having the following lines into the slice web.xml.
Code:
<context-param>
<param-name>contextClass</param-name>
<param-value>
com.springsource.server.web.dm.ServerOsgiBundleXmlWebApplicationContext
</param-value>
</context-param>
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
The same works fine for Host WAR.
I am attaching the sample WARs for your reference.
common.jar – Exposes OSGi service (<osgi:service …..>)
travelAgent.war – Host WAR refers the service exposed by common.jar (<osgi:reference ….>) [works fine]
flightReservation.war – Slice WAR refers the service exposed by common.jar (<osgi:reference ….>) [Not able to autowire beans defined in applicationContext.xml. It means that applicationContext.xml is not getting loaded. Gives error that “No matching bean found”]
Please let me know if this is the correct way to refer an OSGi service from slice WAR?