Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
devaraj s
redirect to login page issue in liferay hook
February 25, 2013 11:25 PM
Answer

devaraj s

Rank: Regular Member

Posts: 206

Join Date: May 21, 2012

Recent Posts

I am oveririding createaccount acction to write my business logic. After veryfiying all condition I am redirecting to login page , but its throwing exception
java.lang.ClassNotFoundException: com.liferay.portlet.login.util.LoginUtil.

exception:
  1java.lang.ClassNotFoundException: com.liferay.portlet.login.util.LoginUtil
  2    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1711)
  3    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1556)
  4    at com.liferay.samplestrutsaction.hook.action.SampleStrutsAction.sendRedirect(SampleStrutsAction.java:143)
  5    at com.liferay.samplestrutsaction.hook.action.SampleStrutsAction.processAction(SampleStrutsAction.java:118)
  6    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  7    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
  8    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  9    at java.lang.reflect.Method.invoke(Method.java:597)
 10    at com.liferay.portal.kernel.bean.ClassLoaderBeanHandler.invoke(ClassLoaderBeanHandler.java:67)
 11    at $Proxy408.processAction(Unknown Source)
 12    at com.liferay.portal.struts.PortletActionAdapter.processAction(PortletActionAdapter.java:55)
 13    at com.liferay.portal.struts.PortletRequestProcessor.process(PortletRequestProcessor.java:169)
 14    at com.liferay.portlet.StrutsPortlet.processAction(StrutsPortlet.java:212)
 15    at com.liferay.portlet.FilterChainImpl.doFilter(FilterChainImpl.java:70)
 16    at com.liferay.portal.kernel.portlet.PortletFilterUtil.doFilter(PortletFilterUtil.java:48)
 17    at com.liferay.portlet.InvokerPortletImpl.invoke(InvokerPortletImpl.java:548)
 18    at com.liferay.portlet.InvokerPortletImpl.invokeAction(InvokerPortletImpl.java:579)
 19    at com.liferay.portlet.InvokerPortletImpl.processAction(InvokerPortletImpl.java:294)
 20    at com.liferay.portal.action.LayoutAction.processPortletRequest(LayoutAction.java:944)
 21    at com.liferay.portal.action.LayoutAction.processLayout(LayoutAction.java:688)
 22    at com.liferay.portal.action.LayoutAction.execute(LayoutAction.java:249)
 23    at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
 24    at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
 25    at com.liferay.portal.struts.PortalRequestProcessor.process(PortalRequestProcessor.java:176)
 26    at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
 27    at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
 28    at javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
 29    at com.liferay.portal.servlet.MainServlet.callParentService(MainServlet.java:560)
 30    at com.liferay.portal.servlet.MainServlet.service(MainServlet.java:537)
 31    at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
 32    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
 33    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
 34    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:72)
 35    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
 36    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
 37    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
 38    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
 39    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
 40    at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:163)
 41    at com.liferay.portal.servlet.filters.secure.SecureFilter.processFilter(SecureFilter.java:294)
 42    at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:57)
 43    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:206)
 44    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:108)
 45    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:73)
 46    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
 47    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
 48    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684)
 49    at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:471)
 50    at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:402)
 51    at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:329)
 52    at com.liferay.portal.servlet.FriendlyURLServlet.service(FriendlyURLServlet.java:138)
 53    at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
 54    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
 55    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
 56    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:72)
 57    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
 58    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
 59    at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:163)
 60    at com.liferay.portal.servlet.filters.strip.StripFilter.processFilter(StripFilter.java:335)
 61    at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:57)
 62    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:206)
 63    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:108)
 64    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
 65    at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:163)
 66    at com.liferay.portal.servlet.filters.gzip.GZipFilter.processFilter(GZipFilter.java:123)
 67    at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:57)
 68    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:206)
 69    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:108)
 70    at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:163)
 71    at com.liferay.portal.servlet.filters.secure.SecureFilter.processFilter(SecureFilter.java:294)
 72    at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:57)
 73    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:206)
 74    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:108)
 75    at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:163)
 76    at com.liferay.portal.servlet.filters.i18n.I18nFilter.processFilter(I18nFilter.java:241)
 77    at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:57)
 78    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:206)
 79    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:108)
 80    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
 81    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
 82    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
 83    at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:163)
 84    at com.liferay.portal.servlet.filters.autologin.AutoLoginFilter.processFilter(AutoLoginFilter.java:246)
 85    at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:57)
 86    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:206)
 87    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:108)
 88    at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:163)
 89    at com.liferay.portal.servlet.filters.sso.ntlm.NtlmPostFilter.processFilter(NtlmPostFilter.java:83)
 90    at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:57)
 91    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:206)
 92    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:108)
 93    at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:163)
 94    at com.liferay.portal.sharepoint.SharepointFilter.processFilter(SharepointFilter.java:80)
 95    at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:57)
 96    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:206)
 97    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:108)
 98    at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:163)
 99    at com.liferay.portal.servlet.filters.virtualhost.VirtualHostFilter.processFilter(VirtualHostFilter.java:216)
100    at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:57)
101    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:206)
102    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:108)
103    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:187)
104    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:95)
105    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
106    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
107    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
108    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
109    at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:738)
110    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:206)
111    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:108)
112    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:167)
113    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:95)
114    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
115    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:167)
116    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:95)
117    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
118    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:187)
119    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:95)
120    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:73)
121    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
122    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
123    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:225)
124    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
125    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
126    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
127    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
128    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
129    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
130    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
131    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:999)
132    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:565)
133    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:307)
134    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
135    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
136    at java.lang.Thread.run(Thread.java:619)
137Feb 26, 2013 7:00:24 AM org.apache.catalina.core.StandardWrapperValve invoke
138SEVERE: Servlet.service() for servlet [Friendly URL Servlet - Public] in context with path [] threw exception [Servlet execution threw an exception] with root cause
139java.lang.ClassNotFoundException: com.liferay.portlet.login.util.LoginUtil
140    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1711)
141    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1556)
142    at com.liferay.samplestrutsaction.hook.action.SampleStrutsAction.sendRedirect(SampleStrutsAction.java:143)
143    at com.liferay.samplestrutsaction.hook.action.SampleStrutsAction.processAction(SampleStrutsAction.java:118)
144    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
145    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
146    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
147    at java.lang.reflect.Method.invoke(Method.java:597)
148    at com.liferay.portal.kernel.bean.ClassLoaderBeanHandler.invoke(ClassLoaderBeanHandler.java:67)
149    at $Proxy408.processAction(Unknown Source)
150    at com.liferay.portal.struts.PortletActionAdapter.processAction(PortletActionAdapter.java:55)
151    at com.liferay.portal.struts.PortletRequestProcessor.process(PortletRequestProcessor.java:169)
152    at com.liferay.portlet.StrutsPortlet.processAction(StrutsPortlet.java:212)
153    at com.liferay.portlet.FilterChainImpl.doFilter(FilterChainImpl.java:70)
154    at com.liferay.portal.kernel.portlet.PortletFilterUtil.doFilter(PortletFilterUtil.java:48)
155    at com.liferay.portlet.InvokerPortletImpl.invoke(InvokerPortletImpl.java:548)
156    at com.liferay.portlet.InvokerPortletImpl.invokeAction(InvokerPortletImpl.java:579)
157    at com.liferay.portlet.InvokerPortletImpl.processAction(InvokerPortletImpl.java:294)
158    at com.liferay.portal.action.LayoutAction.processPortletRequest(LayoutAction.java:944)
159    at com.liferay.portal.action.LayoutAction.processLayout(LayoutAction.java:688)
160    at com.liferay.portal.action.LayoutAction.execute(LayoutAction.java:249)
161    at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
162    at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
163    at com.liferay.portal.struts.PortalRequestProcessor.process(PortalRequestProcessor.java:176)
164    at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
165    at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
166    at javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
167    at com.liferay.portal.servlet.MainServlet.callParentService(MainServlet.java:560)
168    at com.liferay.portal.servlet.MainServlet.service(MainServlet.java:537)
169    at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
170    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
171    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
172    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:72)
173    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
174    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
175    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
176    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
177    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
178    at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:163)
179    at com.liferay.portal.servlet.filters.secure.SecureFilter.processFilter(SecureFilter.java:294)
180    at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:57)
181    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:206)
182    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:108)
183    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:73)
184    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
185    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
186    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684)
187    at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:471)
188    at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:402)
189    at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:329)
190    at com.liferay.portal.servlet.FriendlyURLServlet.service(FriendlyURLServlet.java:138)
191    at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
192    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
193    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
194    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:72)
195    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
196    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
197    at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:163)
198    at com.liferay.portal.servlet.filters.strip.StripFilter.processFilter(StripFilter.java:335)
199    at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:57)
200    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:206)
201    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:108)
202    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
203    at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:163)
204    at com.liferay.portal.servlet.filters.gzip.GZipFilter.processFilter(GZipFilter.java:123)
205    at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:57)
206    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:206)
207    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:108)
208    at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:163)
209    at com.liferay.portal.servlet.filters.secure.SecureFilter.processFilter(SecureFilter.java:294)
210    at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:57)
211    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:206)
212    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:108)
213    at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:163)
214    at com.liferay.portal.servlet.filters.i18n.I18nFilter.processFilter(I18nFilter.java:241)
215    at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:57)
216    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:206)
217    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:108)
218    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
219    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
220    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
221    at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:163)
222    at com.liferay.portal.servlet.filters.autologin.AutoLoginFilter.processFilter(AutoLoginFilter.java:246)
223    at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:57)
224    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:206)
225    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:108)
226    at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:163)
227    at com.liferay.portal.servlet.filters.sso.ntlm.NtlmPostFilter.processFilter(NtlmPostFilter.java:83)
228    at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:57)
229    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:206)
230    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:108)
231    at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:163)
232    at com.liferay.portal.sharepoint.SharepointFilter.processFilter(SharepointFilter.java:80)
233    at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:57)
234    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:206)
235    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:108)
236    at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:163)
237    at com.liferay.portal.servlet.filters.virtualhost.VirtualHostFilter.processFilter(VirtualHostFilter.java:216)
238    at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:57)
239    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:206)
240    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:108)
241    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:187)
242    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:95)
243    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
244    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
245    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
246    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
247    at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:738)
248    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:206)
249    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:108)
250    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:167)
251    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:95)
252    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
253    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:167)
254    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:95)
255    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
256    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:187)
257    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:95)
258    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:73)
259    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
260    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
261    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:225)
262    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
263    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
264    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
265    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
266    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
267    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
268    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
269    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:999)
270    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:565)
271    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:307)
272    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
273    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
274    at java.lang.Thread.run(Thread.java:619)



This is my sample code:

 1
 2public class SampleStrutsAction extends BaseStrutsPortletAction { 
 3    public void processAction( StrutsPortletAction originalStrutsPortletAction, PortletConfig portletConfig, ActionRequest actionRequest, ActionResponse actionResponse)
 4                  throws Exception {
 5       
 6        System.out.println("getting");
 7        String emailAddress = ParamUtil.getString(
 8                actionRequest, "emailAddress");
 9   
10        HttpServletRequest request = PortalUtil.getHttpServletRequest(actionRequest);
11        HttpServletResponse response = PortalUtil.getHttpServletResponse(actionResponse);
12       
13         HttpSession session=request.getSession();
14         
15                 ThemeDisplay themeDisplay = (ThemeDisplay)actionRequest.getAttribute(
16                    WebKeys.THEME_DISPLAY);
17   
18            if(!emailAddress.equals("jdd@liferay.com"))
19                {
20                    System.out.println("going to add session messGe");
21                    SessionMessages.add(
22                            request, "invaliduser","invalid user");
23                    sendRedirect(
24                            actionRequest, actionResponse,themeDisplay, "d@liferay.com","123");
25                }
26                else
27                {
28               
29                originalStrutsPortletAction.processAction( originalStrutsPortletAction, portletConfig, actionRequest, actionResponse);
30                }
31            
32    }
33   
34    protected void sendRedirect(
35            ActionRequest actionRequest, ActionResponse actionResponse,ThemeDisplay themeDisplay,
36            String login,String password)
37        throws Exception {
38
39        HttpServletRequest request = PortalUtil.getHttpServletRequest(
40            actionRequest);
41
42        String redirect = PortalUtil.escapeRedirect(
43            ParamUtil.getString(actionRequest, "redirect"));
44
45       
46            PortletURL loginURL = LoginUtil.getLoginURL(
47                request, themeDisplay.getPlid());
48
49            loginURL.setParameter("login", login);
50
51            redirect = loginURL.toString();
52       
53
54        actionResponse.sendRedirect(redirect);
55    }
56        public String render( StrutsPortletAction originalStrutsPortletAction, PortletConfig portletConfig, RenderRequest renderRequest, RenderResponse renderResponse) throws Exception
57      { 
58        System.out.println("Wrapped /message_boards/view action"); 
59        return originalStrutsPortletAction.render( null, portletConfig, renderRequest, renderResponse);
60      } 
61      public void serveResource( StrutsPortletAction originalStrutsPortletAction, PortletConfig portletConfig, ResourceRequest resourceRequest, ResourceResponse resourceResponse) throws Exception
62      { 
63        originalStrutsPortletAction.serveResource( originalStrutsPortletAction, portletConfig, resourceRequest, resourceResponse);
64      } 
65    }


please can one help me , why its not redirecting.?
devaraj s
RE: redirect to login page issue in liferay hook
February 26, 2013 4:19 AM
Answer

devaraj s

Rank: Regular Member

Posts: 206

Join Date: May 21, 2012

Recent Posts

got solution emoticon
1actionResponse.sendRedirect("/c/portal/login");
Alessio Vezzoni
RE: redirect to login page issue in liferay hook
September 3, 2013 1:14 AM
Answer

Alessio Vezzoni

Rank: New Member

Posts: 13

Join Date: February 28, 2013

Recent Posts

Nice workaround
I have similar problem. i'm overriding struts action with hook and i'm not able to use the original Struts action code because of the LoginUtil class not found.

I think it's a classloader problem with the portal-impl classes, but i'm not sure. Have you found the reason of this problem?

Thank you and regards
subhash lamba
RE: redirect to login page issue in liferay hook
September 3, 2013 1:20 AM
Answer

subhash lamba

Rank: Regular Member

Posts: 136

Join Date: July 7, 2013

Recent Posts

in your portal.properties in hook write the code:

login.events.post=com.XXX.DefaultLandingPageAction

and create class

public class DefaultLandingPageAction extends com.liferay.portal.kernel.events.Action{

@Override
public void run(HttpServletRequest request, HttpServletResponse arg1)
throws ActionException {
}
}