<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <title>Login hook is not working on production environment Liferay 7.1</title>
  <link rel="self" href="https://uat.liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=111284663" />
  <subtitle>Login hook is not working on production environment Liferay 7.1</subtitle>
  <id>https://uat.liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=111284663</id>
  <updated>2026-10-15T11:16:49Z</updated>
  <dc:date>2026-10-15T11:16:49Z</dc:date>
  <entry>
    <title>RE: Login hook is not working on production environment Liferay 7.1</title>
    <link rel="alternate" href="https://uat.liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=111774258" />
    <author>
      <name>Michał Janusz</name>
    </author>
    <id>https://uat.liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=111774258</id>
    <updated>2018-12-11T11:09:36Z</updated>
    <published>2018-12-11T11:09:36Z</published>
    <summary type="html">Resolved. The issue was naming conflict with other bundle. Deploying one
bundle was stopping the other one.</summary>
    <dc:creator>Michał Janusz</dc:creator>
    <dc:date>2018-12-11T11:09:36Z</dc:date>
  </entry>
  <entry>
    <title>Login hook is not working on production environment Liferay 7.1</title>
    <link rel="alternate" href="https://uat.liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=111284662" />
    <author>
      <name>Michał Janusz</name>
    </author>
    <id>https://uat.liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=111284662</id>
    <updated>2018-10-23T08:50:41Z</updated>
    <published>2018-10-23T08:50:41Z</published>
    <summary type="html">Hi&lt;br /&gt;&lt;br /&gt;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:&lt;br /&gt;@Component(immediate = true, property = { &amp;#34;com.liferay.portlet.display-category=category.sample&amp;#34;,&lt;br /&gt;        &amp;#34;com.liferay.portlet.instanceable=true&amp;#34;, &amp;#34;javax.portlet.init-param.template-path=/&amp;#34;,&lt;br /&gt;        &amp;#34;javax.portlet.init-param.view-template=/view.jsp&amp;#34;, &amp;#34;javax.portlet.name=&amp;#34; + LoginHookPortletKeys.LoginHook,&lt;br /&gt;        &amp;#34;javax.portlet.resource-bundle=content.Language&amp;#34;, &amp;#34;javax.portlet.security-role-ref=power-user,user&amp;#34;,&lt;br /&gt;        &amp;#34;mvc.command.name=/login/login&amp;#34;, &amp;#34;javax.portlet.name=com_liferay_login_web_portlet_FastLoginPortlet&amp;#34;,&lt;br /&gt;        &amp;#34;javax.portlet.name=com_liferay_login_web_portlet_LoginPortlet&amp;#34;,&lt;br /&gt;        &amp;#34;service.ranking:Integer=100&amp;#34; }, service = MVCActionCommand.class)&lt;br /&gt;public class LoginHookPortlet extends BaseMVCActionCommand {&lt;br /&gt;&lt;br /&gt;    @Override&lt;br /&gt;    protected void doProcessAction(ActionRequest actionRequest, ActionResponse actionResponse) throws Exception {&lt;br /&gt;        mvcActionCommand.processAction(actionRequest, actionResponse);&lt;br /&gt;        ThemeDisplay themeDisplay = (ThemeDisplay) actionRequest.getAttribute(WebKeys.THEME_DISPLAY);&lt;br /&gt;        long companyId = CompanyThreadLocal.getCompanyId();&lt;br /&gt;        String email = ParamUtil.getString(actionRequest, &amp;#34;login&amp;#34;);&lt;br /&gt;        User user = UserLocalServiceUtil.getUserByEmailAddress(companyId, email);&lt;br /&gt;        if (user != null) {&lt;br /&gt;            ExpandoBridge expandoBridge = user.getExpandoBridge();&lt;br /&gt;            String firstLogin = (String) expandoBridge.getAttribute(&amp;#34;firstLogin&amp;#34;);&lt;br /&gt;            if (firstLogin.equals(&amp;#34;true&amp;#34;)) {&lt;br /&gt;                actionResponse.sendRedirect(themeDisplay.getURLMyAccount().toString());&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    @Reference(&lt;br /&gt;            target = &lt;br /&gt;            &amp;#34;(&amp;amp;(mvc.command.name=/login/login)&amp;#34; +&lt;br /&gt;            &amp;#34;(javax.portlet.name=com_liferay_login_web_portlet_LoginPortlet)&amp;#34; +&lt;br /&gt;            &amp;#34;(component.name=com.liferay.login.web.internal.portlet.action.LoginMVCActionCommand))&amp;#34;&lt;br /&gt;            )&lt;br /&gt;    public void setMvcActionCommand(MVCActionCommand mvcActionCommand) {&lt;br /&gt;        this.mvcActionCommand = mvcActionCommand;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    protected MVCActionCommand mvcActionCommand;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;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:&lt;br /&gt;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]&lt;br /&gt;       at org.eclipse.osgi.container.Module.start(Module.java:429)&lt;br /&gt;       at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incSta                                                                                                                                                             rtLevel(ModuleContainer.java:1582)&lt;br /&gt;       at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incSta                                                                                                                                                             rtLevel(ModuleContainer.java:1562)&lt;br /&gt;       at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doCont                                                                                                                                                             ainerStartLevel(ModuleContainer.java:1533)&lt;br /&gt;       at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispat                                                                                                                                                             chEvent(ModuleContainer.java:1476)&lt;br /&gt;       at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispat                                                                                                                                                             chEvent(ModuleContainer.java:1)&lt;br /&gt;       at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)&lt;br /&gt;       at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)&lt;br /&gt;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]&lt;br /&gt;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]&lt;br /&gt;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]&lt;br /&gt;&lt;br /&gt;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]&lt;br /&gt;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]&lt;br /&gt;2018-10-22 08:35:01.087 ERROR [Framework Event Dispatcher: Equinox Container: 20                                                                                                                                                             744b3f-d5d5-0018-1a5b-89c61a6c3723][osgi_cmpn:97] FrameworkEvent ERROR&lt;br /&gt;org.osgi.framework.BundleException: Could not resolve module: osgi.cmpn [955]_ Unresolved requirement: Import-Package: javax.microedition.io; resolution:=&amp;#34;optional&amp;#34;  _Unresolved requirement: Import-Package: javax.persistence; version=&amp;#34;[1.1.0,2.0.0)&amp;#34;; resolution:=&amp;#34;optional&amp;#34;_  Unresolved requirement: Import-Package: javax.servlet; version=&amp;#34;[2.5.0,3.0.0)&amp;#34;; resolution:=&amp;#34;optional&amp;#34;  _Unresolved requirement: Import-Package: javax.servlet.http; version=&amp;#34;[2.5.0,3.0.0)&amp;#34;; resolution:=&amp;#34;optional&amp;#34;_  Unresolved requirement: Require-Capability: osgi.compile.time.only; filter:=&amp;#34;(&amp;amp;(must.not.resolve=*)(!(must.not.resolve=*)))&amp;#34;_ [Sanitized]&lt;br /&gt;       at org.eclipse.osgi.container.Module.start(Module.java:429)&lt;br /&gt;       at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incSta                                                                                                                                                             rtLevel(ModuleContainer.java:1582)&lt;br /&gt;       at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incSta                                                                                                                                                             rtLevel(ModuleContainer.java:1562)&lt;br /&gt;       at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doCont                                                                                                                                                             ainerStartLevel(ModuleContainer.java:1533)&lt;br /&gt;       at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispat                                                                                                                                                             chEvent(ModuleContainer.java:1476)&lt;br /&gt;       at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispat                                                                                                                                                             chEvent(ModuleContainer.java:1)&lt;br /&gt;       at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)&lt;br /&gt;       at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)&lt;br /&gt;&lt;br /&gt;There are errors in modules which I have never seen before and I did not touch it.&lt;br /&gt;Thank you for help.</summary>
    <dc:creator>Michał Janusz</dc:creator>
    <dc:date>2018-10-23T08:50:41Z</dc:date>
  </entry>
</feed>
