Login hook is not working on production environment Liferay 7.1Login hook is not working on production environment Liferay 7.1https://liferay.dev/en/c/message_boards/find_thread?p_l_id=119785333&threadId=1112846632024-03-29T09:25:24Z2024-03-29T09:25:24ZRE: Login hook is not working on production environment Liferay 7.1Michał Januszhttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=1117742582018-12-11T11:09:36Z2018-12-11T11:09:36ZResolved. The issue was naming conflict with other bundle. Deploying one
bundle was stopping the other one.Michał Janusz2018-12-11T11:09:36ZLogin hook is not working on production environment Liferay 7.1Michał Januszhttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=1112846622018-10-23T08:50:41Z2018-10-23T08:50:41ZHi<br /><br />I have Liferay 7.1.0-ga1. I create login hook using Liferay Module Project. Hook should redirect user when it is a first login:<br />@Component(immediate = true, property = { "com.liferay.portlet.display-category=category.sample",<br /> "com.liferay.portlet.instanceable=true", "javax.portlet.init-param.template-path=/",<br /> "javax.portlet.init-param.view-template=/view.jsp", "javax.portlet.name=" + LoginHookPortletKeys.LoginHook,<br /> "javax.portlet.resource-bundle=content.Language", "javax.portlet.security-role-ref=power-user,user",<br /> "mvc.command.name=/login/login", "javax.portlet.name=com_liferay_login_web_portlet_FastLoginPortlet",<br /> "javax.portlet.name=com_liferay_login_web_portlet_LoginPortlet",<br /> "service.ranking:Integer=100" }, service = MVCActionCommand.class)<br />public class LoginHookPortlet extends BaseMVCActionCommand {<br /><br /> @Override<br /> protected void doProcessAction(ActionRequest actionRequest, ActionResponse actionResponse) throws Exception {<br /> mvcActionCommand.processAction(actionRequest, actionResponse);<br /> ThemeDisplay themeDisplay = (ThemeDisplay) actionRequest.getAttribute(WebKeys.THEME_DISPLAY);<br /> long companyId = CompanyThreadLocal.getCompanyId();<br /> String email = ParamUtil.getString(actionRequest, "login");<br /> User user = UserLocalServiceUtil.getUserByEmailAddress(companyId, email);<br /> if (user != null) {<br /> ExpandoBridge expandoBridge = user.getExpandoBridge();<br /> String firstLogin = (String) expandoBridge.getAttribute("firstLogin");<br /> if (firstLogin.equals("true")) {<br /> actionResponse.sendRedirect(themeDisplay.getURLMyAccount().toString());<br /> }<br /> }<br /><br /> }<br /><br /> @Reference(<br /> target = <br /> "(&(mvc.command.name=/login/login)" +<br /> "(javax.portlet.name=com_liferay_login_web_portlet_LoginPortlet)" +<br /> "(component.name=com.liferay.login.web.internal.portlet.action.LoginMVCActionCommand))"<br /> )<br /> public void setMvcActionCommand(MVCActionCommand mvcActionCommand) {<br /> this.mvcActionCommand = mvcActionCommand;<br /> }<br /><br /> protected MVCActionCommand mvcActionCommand;<br />}<br /><br />Is is working ok in local environment but not on production. When I restart production server I get 2 Errors and I think that it can be connect:<br />2018-10-22 08:35:01.075 ERROR [Framework Event Dispatcher: Equinox Container: 20 744b3f-d5d5-0018-1a5b-89c61a6c3723][javax_enterprise_cdi-api:97] FrameworkEventERROR org.osgi.framework.BundleException: Could not resolve module: javax.enterprise.cdi-api [948]_ Unresolved requirement: Import-Package: javax.inject_ [Sanitized]<br /> at org.eclipse.osgi.container.Module.start(Module.java:429)<br /> at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incSta rtLevel(ModuleContainer.java:1582)<br /> at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incSta rtLevel(ModuleContainer.java:1562)<br /> at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doCont ainerStartLevel(ModuleContainer.java:1533)<br /> at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispat chEvent(ModuleContainer.java:1476)<br /> at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispat chEvent(ModuleContainer.java:1)<br /> at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)<br /> at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)<br />2018-10-22 08:35:01.080 INFO [Start Level: Equinox Container: 20744b3f-d5d5-001 8-1a5b-89c61a6c3723][BundleStartStopLogger:35] STARTED com.liferay.util.taglib_2.0.0 [951]<br />2018-10-22 08:35:01.081 INFO [Start Level: Equinox Container: 20744b3f-d5d5-001 8-1a5b-89c61a6c3723][BundleStartStopLogger:35] STARTED javax.el-api_3.0.0 [952]<br />2018-10-22 08:35:01.082 INFO [Start Level: Equinox Container: 20744b3f-d5d5-001 8-1a5b-89c61a6c3723][BundleStartStopLogger:35] STARTED javax.interceptor-api_1.2.0 [953]<br /><br />2018-10-22 08:35:01.082 INFO [Start Level: Equinox Container: 20744b3f-d5d5-001 8-1a5b-89c61a6c3723][BundleStartStopLogger:35] STARTED javax.servlet-api_3.0.1 [954]<br />2018-10-22 08:35:01.087 INFO [Start Level: Equinox Container: 20744b3f-d5d5-001 8-1a5b-89c61a6c3723][BundleStartStopLogger:35] STARTED portlet-api_3.0.0 [956]<br />2018-10-22 08:35:01.087 ERROR [Framework Event Dispatcher: Equinox Container: 20 744b3f-d5d5-0018-1a5b-89c61a6c3723][osgi_cmpn:97] FrameworkEvent ERROR<br />org.osgi.framework.BundleException: Could not resolve module: osgi.cmpn [955]_ Unresolved requirement: Import-Package: javax.microedition.io; resolution:="optional" _Unresolved requirement: Import-Package: javax.persistence; version="[1.1.0,2.0.0)"; resolution:="optional"_ Unresolved requirement: Import-Package: javax.servlet; version="[2.5.0,3.0.0)"; resolution:="optional" _Unresolved requirement: Import-Package: javax.servlet.http; version="[2.5.0,3.0.0)"; resolution:="optional"_ Unresolved requirement: Require-Capability: osgi.compile.time.only; filter:="(&(must.not.resolve=*)(!(must.not.resolve=*)))"_ [Sanitized]<br /> at org.eclipse.osgi.container.Module.start(Module.java:429)<br /> at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incSta rtLevel(ModuleContainer.java:1582)<br /> at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incSta rtLevel(ModuleContainer.java:1562)<br /> at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doCont ainerStartLevel(ModuleContainer.java:1533)<br /> at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispat chEvent(ModuleContainer.java:1476)<br /> at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispat chEvent(ModuleContainer.java:1)<br /> at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)<br /> at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)<br /><br />There are errors in modules which I ha