Announcement Announcement Module
No announcement yet.
DispatcherPortlet context initialized before application context Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • DispatcherPortlet context initialized before application context


    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:

    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 it normal that the parent context is null?
    Is there a way to force loading application context before portlet contexts?

    Thank you in advance for your help!
    Tommaso Moroni