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
    • Similar Issues:
      Show 5 results 

      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.

        Issue Links

          Activity

          Hide
          NWO Isaac added a comment -

          Is this also going to be fixed for Portal 6.1.1 CE GA2?

          Show
          NWO Isaac added a comment - Is this also going to be fixed for Portal 6.1.1 CE GA2?
          Hide
          Tammy Fong added a comment -

          Hi NWO,

          Portal 6.1.1.1 CE GA2 was released before the commit so it will not have the fix. However, the fix is on the current trunk head, so this issue should be fixed in the next version of Liferay Portal. Thanks,

          Show
          Tammy Fong added a comment - Hi NWO, Portal 6.1.1.1 CE GA2 was released before the commit so it will not have the fix. However, the fix is on the current trunk head, so this issue should be fixed in the next version of Liferay Portal. Thanks,
          Hide
          Andrius Kurtinaitis added a comment -

          It still fails if spring beans try to access PortalProps while initializing.

          Show
          Andrius Kurtinaitis added a comment - It still fails if spring beans try to access PortalProps while initializing.
          Hide
          Koen De Jaeger added a comment -

          This BaseDeployer.java can't be overriden with a hook, right?

          Show
          Koen De Jaeger added a comment - This BaseDeployer.java can't be overriden with a hook, right?
          Hide
          Thorsten Glaser added a comment -

          Hi everyone,

          the patch by Vedran Pugar is on his github (6.1.x_LPS-29103 against 6.1.X stable branch). I wonder why it was not applied to the Liferay 6.1.X stable branch at ↓ ?

          https://github.com/liferay/liferay-portal/tree/6.1.x

          I’d be glad if you could apply it there.

          Thanks in advance!

          Show
          Thorsten Glaser added a comment - Hi everyone, the patch by Vedran Pugar is on his github (6.1.x_ LPS-29103 against 6.1.X stable branch). I wonder why it was not applied to the Liferay 6.1.X stable branch at ↓ ? https://github.com/liferay/liferay-portal/tree/6.1.x I’d be glad if you could apply it there. Thanks in advance!

            People

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

              Dates

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

                Development

                  Structure Helper Panel