I am using OSGI with Spring MVC,details are as follows
Bundle b1-declares message source as bean. the message resource is success fully autowired in a service in bundleb1. Entry for Message Source in xml is
<bean id="messageSource" class="org.synyx.messagesource.InitializableMessageSource">
<property name="basename" value="ApplicationResources"/>
<property name="messageProvider">
<bean class="org.synyx.messagesource.jdbc.JdbcMessageProvider">
<property name="dataSource" ref="dataSource"/>
</bean>
</property>
</bean>
Message source is exposed as a service in osgi-context.xml of bundle b1 as follows
<osgi:service interface="org.springframework.context.MessageSource" ref="messageSource"/>
To import the message resources in the WAB bundle, have made following entry in osgi-context.xml of WAB have made following entry to import the messageSource service exposed by bundle b1.
Note - i have not created messageSource bean in WAB(not defined messageSource in *-servlet.xml) as i expect the messageSource to be imported from Bundle B1 and be used by spring for lang resolution.
Problem is -when i hit sample Jsp placed in WAB i recieve error
javax.servlet.ServletException: javax.servlet.jsp.JspTagException: No message found under code 'user.nametext' for locale 'en_US'.
Analysis- Further debugging the spring code i found that messagesource used in webapplication context is of type DelegatingMessageSource. But the messageSource imported from bundle b1 expose object of type InitializableMessageSource. This means webapplication context is not initialized with messageSource that is imported through osgi-context.xml of WAB.
PLS help...