Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-29103

Custom Spring MVC -portlets broken after upgrading to Liferay 6.1 GA2 (web.xml listener order)

    Details

    • Branch Version/s:
      6.1.x, 6.0.x
    • Backported to Branch:
      Committed
    • Epic/Theme:
    • Fix Priority:
      5

      Description

      We have the structure where applicationContext.xml contains shared beans (service layer, dao layer and such) and is loaded by org.springframework.web.context.ContextLoaderListener . Additionally all portlets have their own context loading MVC related beans (controllers, view resolvers, etc).

      Generated listeners in web.xml on version 6.1 GA1:

      <listener>
      <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
      </listener>
      <listener>
      <listener-class>com.liferay.portal.kernel.servlet.SerializableSessionAttributeListener</listener-class>
      </listener>
      <listener>
      <listener-class>com.liferay.portal.kernel.servlet.PortletContextListener</listener-class>
      </listener>

      After upgrading to Liferay 6.1 GA2 deployment sorts listeners in web.xml alphabetically:

      <listener>
      <listener-class>com.liferay.portal.kernel.servlet.PluginContextListener</listener-class>
      </listener>
      <listener>
      <listener-class>com.liferay.portal.kernel.servlet.SerializableSessionAttributeListener</listener-class>
      </listener>
      <listener>
      <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
      </listener>

      This causes portlet context to be loaded first and dependent beans from application context are missing.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                4 Vote for this issue
                Watchers:
                21 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  4 years, 18 weeks, 2 days ago

                  Subcomponents