Foren

Liferay modifies web.xml on deploy (listener ordering changed in 6.1.1)

Front Line, geändert vor 12 Jahren.

Liferay modifies web.xml on deploy (listener ordering changed in 6.1.1)

New Member Beiträge: 17 Beitrittsdatum: 15.04.11 Neueste Beiträge
Hi,

Liferay modifies the web.xml of your portlet on deploy.
It apparently inserts at least a couple of lines. The problem is that my struts portlets don't work if the spring context listener isn't the first listener. Liferay sets your own custom listeners as the last ones.

My web.xml

<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>

After deploy

<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>

Has the ordering changed between 6.1 and 6.1.1? It used to work in 6.1 (my own listener was the first one, now it is the last and my portlet doesn't work)
Front Line, geändert vor 12 Jahren.

RE: Liferay modifies web.xml on deploy (listener ordering changed in 6.1.1)

New Member Beiträge: 17 Beitrittsdatum: 15.04.11 Neueste Beiträge
Apparently this issue from years ago is about the same problem
http://issues.liferay.com/browse/LEP-5062

I don't understand why Liferay must mess with the web.xml in the first place... If there are some mandatory listeners etc that Liferay needs then just document the behaviour and developers will themselves add the needed lines to the web.xml. But a weird architecture if a standard portlet needs these changes to work in Liferay.

Any workarounds or suggestions?
Front Line, geändert vor 12 Jahren.

RE: Liferay modifies web.xml on deploy (listener ordering changed in 6.1.1)

New Member Beiträge: 17 Beitrittsdatum: 15.04.11 Neueste Beiträge
Ok, the issue above talks about the class PortletContextLoaderListener but the issue is still the same, ie. messing with listeners in the web.xml
thumbnail
David H Nebinger, geändert vor 12 Jahren.

RE: Liferay modifies web.xml on deploy (listener ordering changed in 6.1.1)

Liferay Legend Beiträge: 14923 Beitrittsdatum: 02.09.06 Neueste Beiträge
Hmm, maybe the issue is yours...

Liferay is totally based on struts and doesn't seem to have any problems whatsoever...
Front Line, geändert vor 12 Jahren.

RE: Liferay modifies web.xml on deploy (listener ordering changed in 6.1.1)

New Member Beiträge: 17 Beitrittsdatum: 15.04.11 Neueste Beiträge
What a helpful answer, thanks!

The exact same portlet works on 6.1, but doesn't work with 6.1.1, so it seems logical to you that the problem is somewhere else than in a change made in how 6.1.1 handles the web.xml on deploy? And if you check BaseDeployer.java in Liferay you can see that it now prepends "com.liferay.portal.kernel.servlet.PluginContextListener" before your own listeners.
Liferay's portlets do not use Spring as Struts' object factory.

Has anybody tried if Spring MVC portlets work?
František Hartman, geändert vor 12 Jahren.

RE: Liferay modifies web.xml on deploy (listener ordering changed in 6.1.1)

New Member Beitrag: 1 Beitrittsdatum: 12.03.12 Neueste Beiträge
I have tried out 6.1.1 today and had the same issue - works like a charm on 6.1.0, breaks on 6.1.1 because root application context is not initialized yet.

It is reported as a bug.

http://issues.liferay.com/browse/LPS-29103