Hi,
I have a Spring Portlet MVC project, in which I defined a DispatcherPortlet with name moneybins.
In the portlet context (moneybins-portlet.xml file) I defined all the controllers and web-related beans, while in the application context I defined services.
When I deploy the project on Liferay 6.1.1 bundled with Tomcat, Spring cannot instantiate a Controller with an injected dependency on a Service, because it cannot find any registered Service. From the logs it seems that the portlet context is started before the application context:
Is it normal that the parent context is null?Code:DEBUG org.springframework.web.portlet.DispatcherPortlet - Portlet with name 'moneybins' will try to create custom ApplicationContext context of class 'org.springframework.web.portlet.context.XmlPortletApplicationContext', using parent context [null]
Is there a way to force loading application context before portlet contexts?
Thank you in advance for your help!
Tommaso Moroni


Reply With Quote