-
Type:
Bug
-
Status: Closed
-
Resolution: Fixed
-
Affects Version/s: 7.0.0 DXP FP23, 7.0.X EE, Master
-
Fix Version/s: 7.0.0 DXP FP33, 7.0.0 DXP FP35, 7.0.0 DXP SP7, 7.0.5 CE GA6, 7.0.X, 7.1.0 M1, 7.1.X, Master
-
Component/s: Core Infrastructure
-
Branch Version/s:7.0.x
-
Backported to Branch:Committed
-
Story Points:1.5
-
Fix Priority:3
-
Git Pull Request:
Steps to Reproduce - 70x
- Start portal
- Create and deploy a custom module which customizes one of our portal StrutsAction (find attached), for example
package com.test import com.liferay.portal.comment.action.EditDiscussionStrutsAction; import com.liferay.portal.kernel.log.Log; import com.liferay.portal.kernel.log.LogFactoryUtil; import com.liferay.portal.kernel.struts.StrutsAction; import org.osgi.service.component.annotations.Component; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @Component( immediate = true, property = { "path=/portal/comment/edit_discussion" }, service = StrutsAction.class) public class CustomEditDiscussionAction extends EditDiscussionStrutsAction { /** Defines the logger instance. */ private static final Log _log = LogFactoryUtil.getLog(CustomEditDiscussionAction.class); @Override public String execute(HttpServletRequest request, HttpServletResponse response) throws Exception { _log.info("CustomEditDiscussionAction.execute()"); return super.execute(request, response); } }
Note: this example no longer applicable for master as "comment/edit_discussion" StrutsAction has been modularized into "collaboration/comment/comment-taglib".
- Add "Page Comments" to a page
- Post a comment
Result: "CustomEditDiscussionAction.execute()" is printed in the log
- Restart the portal
- Comment again
Result: No message in the log, custom action is not executed
Workaround: Modify component annotation and use "server.ranking":
@Component( immediate = true, property = { "path=/portal/comment/edit_discussion", "service.ranking:Integer=-1" }, service = StrutsAction.class)
Technical Background
StrutsActionRegistryUtil should use ServiceTrackerMap
- relates
-
LRDOCS-3714 StrutsPortletAction blade sample could be misleading
-
- Open
-