Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-10904

HotDeployException when redeploying language hook

    Details

      Description

      Steps to reproduce :

      create a language hook
      deploy the hook
      shut down the server
      redeploy the hook again
      start up the server

      The following error occurs :

      com.liferay.portal.kernel.deploy.hot.HotDeployException: Error unregistering hook for dzoin-hook
      at com.liferay.portal.kernel.deploy.hot.BaseHotDeployListener.throwHotDeployException(BaseHotDeployListener.java:47)
      at com.liferay.portal.deploy.hot.HookHotDeployListener.invokeUndeploy(HookHotDeployListener.java:231)
      at com.liferay.portal.kernel.deploy.hot.HotDeployUtil._fireUndeployEvent(HotDeployUtil.java:155)
      at com.liferay.portal.kernel.deploy.hot.HotDeployUtil.fireUndeployEvent(HotDeployUtil.java:39)
      at com.liferay.portal.kernel.servlet.HookContextListener.contextDestroyed(HookContextListener.java:49)
      at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:4011)
      at org.apache.catalina.core.StandardContext.stop(StandardContext.java:4615)
      at org.apache.catalina.startup.HostConfig.checkResources(HostConfig.java:1236)
      at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1342)
      at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:303)
      at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
      at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1337)
      at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1601)
      at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1610)
      at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1590)
      at java.lang.Thread.run(Thread.java:619)
      Caused by: java.lang.NullPointerException
      at java.util.concurrent.ConcurrentHashMap.put(ConcurrentHashMap.java:881)
      at com.liferay.portal.language.LanguageResources.putLanguageMap(LanguageResources.java:66)
      at com.liferay.portal.deploy.hot.HookHotDeployListener$LanguagesContainer.unregisterLanguages(HookHotDeployListener.j
      ava:1913)
      at com.liferay.portal.deploy.hot.HookHotDeployListener.doInvokeUndeploy(HookHotDeployListener.java:715)
      at com.liferay.portal.deploy.hot.HookHotDeployListener.invokeUndeploy(HookHotDeployListener.java:228)

      The problem lies in HookHotDeployListener,LanguagesContainer

      The add language method regusters the new language map in the LanguageResources than puts the old language map in the languesmap of the languages container. In the above scenario the old language map will be null

      Later unregisterLanguages is called,. and it itterates over the LanguagesContainer language map, encounters the null value and tries to invoke
      LanguageResources.putLanguageMap(locale, languageMap); with the null language map

      This fails

      The eventual result will be classloading errors on login and you will have to restart the server again

      I attached a possible fix

        Attachments

          Activity

            People

            Assignee:
            support-lep@liferay.com SE Support
            Reporter:
            jelmer Jelmer Kuperus (Inactive)
            Participants of an Issue:
            Recent user:
            Esther Sanz
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Days since last comment:
              10 years, 14 weeks, 5 days ago

                Packages

                Version Package
                6.0.5 GA