Greetings,
I would like to straighten out my understanding of the different application contexts that can be created for web apps in dm server.
1. Will dm extender create context for /META-INF/spring/*.xml entries in case of a war deployment?
1.1 If yes, what its relationship to the app context created from web.xml configuration? Both root and servlet, i.e. does it become a parent of root webapp context if it is defined or servlet context if root is not defined?
2. Is it approved practice to publish osgi services from root web app context given context-class of ServerOsgiBundleXmlWebApplicationContext?
3. This is more of a Slices related: what is relationship of host application context to the Slice-child? Can Slice child create it's own root webapp context?
The issue I am seeing is that services published from web apps or slices are never registered in services registry or somehow missed by <osgi:list/> processing.
Environment:
1. dmServer M4 (can't move to M5 because of Slices)
2. deployment is done with scoped+atomic plan.
I tried the following in the Host Slice bundle.
web.xml
applicationContext-osgi.xmlCode:<context-param> <param-name>contextConfigLocation</param-name> <param-value> /WEB-INF/spring/context/applicationContext-osgi.xml /WEB-INF/spring/context/applicationContext.xml /WEB-INF/spring/context/spring-security-config.xml </param-value> </context-param> <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>
This configuration always fails because <osgi:list id="securityMetadataSources"/> never finds any services. It is actually strange, because userDetailsServices publishing bundle also publishes FilterInvocationSecurityMetadataSource bean plus I am explicitly publishing a service in the same config file.Code:<!-- locally created bean from spring-security-config.xml --> <osgi:service ref="hostFilterInvocationSecurityMetadataSource" interface="org.springframework.security.web.access.intercept.FilterInvocationSecurityMetadataSource"> <osgi:service-properties> <entry key="app" value="host"/> </osgi:service-properties> </osgi:service> <osgi:list id="securityMetadataSources" interface="org.springframework.security.web.access.intercept.FilterInvocationSecurityMetadataSource" cardinality="1..N" comparator-ref="securityMetadataSourceComparator" greedy-proxying="true"/> <bean id="securityMetadataSourceComparator" class="org.springframework.core.OrderComparator"/> <!-- service is published by another bundle --> <osgi:list id="userDetailsServices" interface="org.springframework.security.core.userdetails.UserDetailsService" cardinality="0..N"/>
From looking at the log files (trace on org.springframework.osgi) - I see that all beans are created properly and "hostFilterInvocationSecurityMetadataSource" is published as a service.
Are the issues I am seeing related to the Slices or to the implementation of the deployers.
This issue has been impeding me for a few days now and driving me nuts.


