Details

      Description

      Reproduction steps:
      1) Create a hook that modifies 2 or more JSP files (please see my test hook is attached: testjsphook1-hook-6.2.10.1.war)
      2) Start the portal and go to Control Panel -> Portal Administration ->Log Levels
      3) Set log level to DEBUG for the com.liferay.portal.deploy.hot package
      4) Deploy the hook
      Actual result:
      Only the first JSP file is logged in my example twice

      Custom JSP files:
      c:\Liferay\Liferay\temp\liferay-portal-6.2-ee-sp13\tomcat-7.0.62\temp\29-testjsphook1-hook\/META-INF/custom_jsps/html/common/error.jsp
      c:\Liferay\Liferay\temp\liferay-portal-6.2-ee-sp13\tomcat-7.0.62\temp\29-testjsphook1-hook\/META-INF/custom_jsps/html/common/error.jsp

      Expected result result:
      All the custom JSP files are listed

      Custom JSP files:
      C:\Users\liferay\bundles\ee-6.1.x\tomcat-7.0.62\temp\3-testjsphook1-hook\/META-INF/custom_jsps/html/common/error.jsp
      C:\Users\liferay\bundles\ee-6.1.x\tomcat-7.0.62\temp\3-testjsphook1-hook\/META-INF/custom_jsps/html/common/referer_common.jsp

      Reason:
      The HookHotDeployListener.initCustomJspDir (row 1335) method has a debug section looking like:

      if (_log.isDebugEnabled()) {
      	StringBundler sb = new StringBundler(customJsps.size() * 2);
      
      	sb.append("Custom JSP files:\n");
      
      	for (int i = 0; i < customJsps.size(); i++) {
      		String customJsp = customJsps.get(0);
      
      		sb.append(customJsp);
      
      		if ((i + 1) < customJsps.size()) {
      			sb.append(StringPool.NEW_LINE);
      		}
      	}
      
      	Log log = SanitizerLogWrapper.allowCRLF(_log);
      
      	log.debug(sb.toString());
      }

      The for-clause contains an error, "String customJsp = customJsps.get(0);" should probably be replaced with "String customJsp = customJsps.get( i );".

      Note
      Core has been refactored in master/7.0 by LPS-56540.


      Log on master:

      16:56:13,986 DEBUG [localhost-startStop-2][ExtHotDeployListener:110] Invoking deploy for testjsphook1-hook
      16:56:13,987 INFO  [localhost-startStop-2][HookHotDeployListener:473] Registering hook for testjsphook1-hook
      16:56:13,995 DEBUG [localhost-startStop-2][CustomJspBagRegistryUtil:313] SanitizerLogWrapper warning: Following message contains CRLF characters
      Custom JSP files:
      /META-INF/custom_jsps/html/common/error.jsp
      /META-INF/custom_jsps/html/common/error.jsp
      

      Log on master after the fix:

      Custom JSP files:
      /META-INF/custom_jsps/html/common/error.jsp
      /META-INF/custom_jsps/html/common/referer_common.jsp
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              beck.liu Beck Liu
              Reporter:
              tibor.jandi Tibor Jandi
              Participants of an Issue:
              Recent user:
              Esther Sanz
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since last comment:
                6 years, 7 weeks ago

                  Packages

                  Version Package
                  6.2.X EE
                  7.0.0 Alpha 4