Details

    • Branch Version/s:
      6.1.x
    • Backported to Branch:
      Committed
    • Similar Issues:
      Show 5 results 

      Description

      If you create a struts action hook to path /portal/layout you'll end up getting ClassNotFoundException in certain cases.

      To reproduce take the sample-struts-action-hook and

      1) add a new hook for path /portal/layout by adding following in the liferay-hook.xml

             <struts-action>
                      <struts-action-path>/portal/layout</struts-action-path>
                      <struts-action-impl>com.liferay.samplestrutsaction.hook.action.SampleLayoutStrutsAction</struts-action-impl>
              </struts-action>
      

      2) Then create class com.liferay.samplestrutsaction.hook.action.SampleLayoutStrutsAction with content

      package com.liferay.samplestrutsaction.hook.action;
      
      import com.liferay.portal.kernel.struts.BaseStrutsAction;
      import com.liferay.portal.kernel.struts.StrutsAction;
      
      import javax.servlet.http.HttpServletRequest;
      import javax.servlet.http.HttpServletResponse;
      
      /**
       * @author Mika Koivisto
       */
      public class SampleLayoutStrutsAction extends BaseStrutsAction {
      
              @Override
              public String execute(
                              StrutsAction originalStrutsAction,
                              HttpServletRequest request, HttpServletResponse response)
                      throws Exception {
      
                      System.out.println("SampleLayoutStrutsAction.execute() - " + request.getRequestURI());
      
                      return originalStrutsAction.execute(request, response);
              }
      
      }
      

      3) Deploy the hook.

      4) Go to portal home page.

      5) Click login

      6) Click Liferay logo and then you should see follow stacktrace

      NFO: Server startup in 30202 ms
      SampleLayoutStrutsAction.execute() - /c/portal/layout
      21:56:56,154 ERROR [http-bio-8080-exec-1][RequestProcessor:296] 
      java.lang.ClassNotFoundException: com.liferay.portlet.myplaces.action.ViewAction
      	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1701)
      	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1546)
      	at org.apache.struts.util.RequestUtils.applicationClass(RequestUtils.java:117)
      	at org.apache.struts.util.RequestUtils.applicationInstance(RequestUtils.java:143)
      	at org.apache.struts.action.RequestProcessor.processActionCreate(RequestProcessor.java:292)
      	at com.liferay.portal.struts.PortletRequestProcessor.processActionCreate(PortletRequestProcessor.java:400)
      	at com.liferay.portal.struts.PortletRequestProcessor.process(PortletRequestProcessor.java:143)
      	at com.liferay.portlet.StrutsPortlet.processAction(StrutsPortlet.java:212)
      	at com.liferay.portlet.FilterChainImpl.doFilter(FilterChainImpl.java:70)
      	at com.liferay.portal.kernel.portlet.PortletFilterUtil.doFilter(PortletFilterUtil.java:48)
      	at com.liferay.portlet.InvokerPortletImpl.invoke(InvokerPortletImpl.java:548)
      	at com.liferay.portlet.InvokerPortletImpl.invokeAction(InvokerPortletImpl.java:579)
      	at com.liferay.portlet.InvokerPortletImpl.processAction(InvokerPortletImpl.java:294)
      	at com.liferay.portal.action.LayoutAction.processPortletRequest(LayoutAction.java:943)
      	at com.liferay.portal.action.LayoutAction.processLayout(LayoutAction.java:687)
      	at com.liferay.portal.action.LayoutAction.execute(LayoutAction.java:250)
      	at com.liferay.portal.struts.StrutsActionAdapter.execute(StrutsActionAdapter.java:45)
      	at com.liferay.samplestrutsaction.hook.action.SampleLoginAction.execute(SampleLoginAction.java:41)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      	at java.lang.reflect.Method.invoke(Method.java:597)
      	at com.liferay.portal.kernel.bean.ClassLoaderBeanHandler.invoke(ClassLoaderBeanHandler.java:67)
      	at $Proxy383.execute(Unknown Source)
      	at com.liferay.portal.struts.ActionAdapter.execute(ActionAdapter.java:50)
      	at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
      	at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
      	at com.liferay.portal.struts.PortalRequestProcessor.process(PortalRequestProcessor.java:176)
      	at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
      	at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
      	at com.liferay.portal.servlet.MainServlet.callParentService(MainServlet.java:560)
      	at com.liferay.portal.servlet.MainServlet.service(MainServlet.java:537)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:72)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
      	at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:163)
      	at com.liferay.portal.servlet.filters.secure.SecureFilter.processFilter(SecureFilter.java:318)
      	at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:57)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:206)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:108)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:73)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
      	at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684)
      	at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:471)
      	at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:402)
      	at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:329)
      	at com.liferay.portal.servlet.FriendlyURLServlet.service(FriendlyURLServlet.java:138)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:72)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
      	at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:163)
      	at com.liferay.portal.servlet.filters.gzip.GZipFilter.processFilter(GZipFilter.java:123)
      	at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:57)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:206)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:108)
      	at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:163)
      	at com.liferay.portal.servlet.filters.secure.SecureFilter.processFilter(SecureFilter.java:318)
      	at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:57)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:206)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:108)
      	at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:163)
      	at com.liferay.portal.servlet.filters.i18n.I18nFilter.processFilter(I18nFilter.java:241)
      	at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:57)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:206)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:108)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
      	at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:163)
      	at com.liferay.portal.servlet.filters.etag.ETagFilter.processFilter(ETagFilter.java:56)
      	at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:57)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:206)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:108)
      	at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:163)
      	at com.liferay.portal.servlet.filters.autologin.AutoLoginFilter.processFilter(AutoLoginFilter.java:232)
      	at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:57)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:206)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:108)
      	at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:163)
      	at com.liferay.portal.servlet.filters.sso.ntlm.NtlmPostFilter.processFilter(NtlmPostFilter.java:83)
      	at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:57)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:206)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:108)
      	at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:163)
      	at com.liferay.portal.sharepoint.SharepointFilter.processFilter(SharepointFilter.java:88)
      	at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:57)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:206)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:108)
      	at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:163)
      	at com.liferay.portal.servlet.filters.virtualhost.VirtualHostFilter.processFilter(VirtualHostFilter.java:191)
      	at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:57)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:206)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:108)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:187)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:95)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
      	at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:738)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:206)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:108)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:167)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:95)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:167)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:95)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:187)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:95)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:73)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
      	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)
      	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
      	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
      

        Issue Links

          Activity

          Hide
          Mika Koivisto added a comment -

          LPS-27131 describes another way to produce the problem with classloader but in this case it's with portlet struts action.

          Show
          Mika Koivisto added a comment - LPS-27131 describes another way to produce the problem with classloader but in this case it's with portlet struts action.
          Hide
          Michael Saechang added a comment -

          Committed on:
          Portal 6.2.x GIT ID: 770ccf7b3e4c724faed7fe395aeeac9005b31562.

          Show
          Michael Saechang added a comment - Committed on: Portal 6.2.x GIT ID: 770ccf7b3e4c724faed7fe395aeeac9005b31562.
          Hide
          Justin Choi added a comment -

          Yang Gao, this was assigned to me specifically. If you have started work, please let me know your progress. Thanks.

          Show
          Justin Choi added a comment - Yang Gao, this was assigned to me specifically. If you have started work, please let me know your progress. Thanks.
          Hide
          Justin Choi added a comment -

          PASSED Manual Testing following the steps in the description.

          Fixed on:
          Tomcat 7 + MySQL 5. Portal 6.1.x EE GIT ID: ce1c85a369a14ab5d685432add650aba4929166b. Plugins 6.1.x EE GIT ID: 58217456efc138b3bf418d8619f246c790864577.
          Tomcat 7 + MySQL 5. Portal 6.2.x GIT ID: 14a70be11e16deaac76199c4ad38f5d55459d714. Plugins 6.2.x GIT ID: e0d43efb7be954d3ce1854727ce8cf732e5b93b2.

          Clicking the Liferay Logo will not cause a stacktrace error.

          Show
          Justin Choi added a comment - PASSED Manual Testing following the steps in the description. Fixed on: Tomcat 7 + MySQL 5. Portal 6.1.x EE GIT ID: ce1c85a369a14ab5d685432add650aba4929166b. Plugins 6.1.x EE GIT ID: 58217456efc138b3bf418d8619f246c790864577. Tomcat 7 + MySQL 5. Portal 6.2.x GIT ID: 14a70be11e16deaac76199c4ad38f5d55459d714. Plugins 6.2.x GIT ID: e0d43efb7be954d3ce1854727ce8cf732e5b93b2. Clicking the Liferay Logo will not cause a stacktrace error.

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since last comment:
                2 years, 44 weeks, 3 days ago

                Development

                  Subcomponents

                    Structure Helper Panel