Re: IllegalStateException from org.apache.struts2.portlet.dispatcher.Jsr168Dispatcher

2008-01-04 Thread Nils-Helge Garli Hegvik
There's a couple of issues with this. First, a portlet only produces
page fragments, you can't use ,  or  tags. So you'll
have to find another way to refresh the page. Second, the url-tag
needs a specified action to produce a correct URL in a portlet
environment (there's a JIRA ticket for using the executing action if
no action is specified, but this hasn't been implemented yet). Try
using  instead.

Nils-H

On Jan 2, 2008 10:05 PM, Wanjun Wang <[EMAIL PROTECTED]> wrote:
>
>
> Nils-H,
>
>  I noticed some error in my struts-view.xml.  It now looks like:
>  
>namespace="/view">
>  
>  /WEB-INF/view/index.jsp
>  
>
>   class="org.apache.struts2.showcase.wait.LongProcessAction">
>  
>  
>  3000
>  1000
>  
>  /WEB-INF/view/wait.jsp
>  /WEB-INF/view/complete.jsp
>  
>
>  
>  
>
>  wait.jsp has
>  <%@ taglib prefix="s" uri="/struts-tags" %>
>  
>  
>  "/>
>  
>
>  
>  
>  We are processing your request. Please wait.
>  
>
>  
>  You can click this link to ">refresh.
>
>  
>  
>
>  It's fine if it goes straight to success page. The problem is with wait
> page. The new exception is:
>  [1/2/08 16:00:10:140 EST] 004c PortletRender E
> com.ibm.wps.engine.tags.PortletRenderTag doStartTag EJPEJ0066E: The portlet
> could not be rendered.
>  javax.portlet.PortletException: Error executing action renderDirect
>
>  at
> org.apache.struts2.portlet.dispatcher.Jsr168Dispatcher.serviceAction(Jsr168Dispatcher.java:426)
>  at
> org.apache.struts2.portlet.dispatcher.Jsr168Dispatcher.render(Jsr168Dispatcher.java:299)
>  ..
>  Caused by: javax.portlet.PortletException: java.lang.NullPointerException
>  at
> com.ibm.ws.portletcontainer.core.impl.PortletRequestDispatcherImpl.include(PortletRequestDispatcherImpl.java:136)
>  at
> com.ibm.ws.portletcontainer.core.impl.PortletRequestDispatcherImpl.include(PortletRequestDispatcherImpl.java:256)
>  at
> org.apache.struts2.portlet.result.PortletResult$IncludeTemplate.include(PortletResult.java:208)
>  at
> org.apache.struts2.portlet.result.PortletResult.executeRenderResult(PortletResult.java:177)
>  at
> org.apache.struts2.portlet.result.PortletResult.doExecute(PortletResult.java:77)
>
>  at
> org.apache.struts2.dispatcher.StrutsResultSupport.execute(StrutsResultSupport.java:178)
>  ..
>  Caused by: java.lang.NullPointerException
>  at
> org.apache.struts2.portlet.util.PortletUrlHelper.buildResourceUrl(PortletUrlHelper.java:200)
>  at org.apache.struts2.components.URL.end(URL.java:260)
>  at
> org.apache.struts2.views.jsp.ComponentTagSupport.doEndTag(ComponentTagSupport.java:43)
>  ..
>
>  Could this be caused by the portlet container?
>
>  Thanks.
>
>  Wanjun Wang
>
>  "Nils-Helge Garli Hegvik" <[EMAIL PROTECTED]>
>
>
>
>
>
>
>
> "Nils-Helge Garli Hegvik" <[EMAIL PROTECTED]>
>
> 01/02/2008 02:34 PM
> Please respond to
>  "Struts Users Mailing List" 
>
>
> To
>  "Struts Users Mailing List" 
>
>
> cc
>
>
>
> Subject
>  Re: IllegalStateException from
> org.apache.struts2.portlet.dispatcher.Jsr168Dispatcher
>
>
>
> I have never tested the execute and wait stuff, so I don't really know
>  how it works. But from reading the code for the interceptor, and
>  reading the stack trace, I would guess that this happens because the
>  default "wait" result is invoked and is not a result type that is
>  supported in a portlet. You could try configuring a result for "wait"
>  for the action explicitly. If you still have problems, please provide
>  the relevant configuration snippets.
>
>  Nils-H
>
>  On Jan 2, 2008 7:01 PM, Wanjun Wang <[EMAIL PROTECTED]> wrote:
>  > Hi,
>  >
>  > Has anyone used interceptor-ref in a portlet?  I'm trying to port the
>  > execute-and-wait showcase to a portlet.  The initial page displays fine,
>  > but upon submit, the following exception occurs:
>  >
>  > [1/2/08 11:49:34:468 EST] 002b EventQueueMan E
>  > com.ibm.wps.pe.pc.waspc.event.EventQueueManager processEventLoop
>  > EJPPG1122E: An error occurred during portlet event processing.
>  >  javax.portlet.PortletException: Error
>  > executing action longProcess3
>  >   at
>  >
> org.apache.struts2.portlet.dispatcher.Jsr168Dispatcher.serviceAction(Jsr168Dispatcher.java:426)
>  >   at
>  >
> org.apache.struts2.portlet.dispatcher.Jsr168Dispatcher.processAction(Jsr168Dispatcher.java:274)
>  > ..
> 

Re: IllegalStateException from org.apache.struts2.portlet.dispatcher.Jsr168Dispatcher

2008-01-02 Thread Wanjun Wang

Nils-H,

I noticed some error in my struts-view.xml.  It now looks like:

  

  /WEB-INF/view/index.jsp





3000
1000

/WEB-INF/view/wait.jsp
/WEB-INF/view/complete.jsp


  


wait.jsp has
<%@ taglib prefix="s" uri="/struts-tags" %>


"
/>




We are processing your request. Please wait.



You can click this link to ">
refresh.




It's fine if it goes straight to success page.  The problem is with wait
page.  The new exception is:
[1/2/08 16:00:10:140 EST] 004c PortletRender E
com.ibm.wps.engine.tags.PortletRenderTag doStartTag EJPEJ0066E: The portlet
could not be rendered.
 javax.portlet.PortletException: Error
executing action renderDirect
  at
org.apache.struts2.portlet.dispatcher.Jsr168Dispatcher.serviceAction(Jsr168Dispatcher.java:426)
  at
org.apache.struts2.portlet.dispatcher.Jsr168Dispatcher.render(Jsr168Dispatcher.java:299)
..
Caused by: javax.portlet.PortletException: java.lang.NullPointerException
  at
com.ibm.ws.portletcontainer.core.impl.PortletRequestDispatcherImpl.include(PortletRequestDispatcherImpl.java:136)
  at
com.ibm.ws.portletcontainer.core.impl.PortletRequestDispatcherImpl.include(PortletRequestDispatcherImpl.java:256)
  at
org.apache.struts2.portlet.result.PortletResult$IncludeTemplate.include(PortletResult.java:208)
  at
org.apache.struts2.portlet.result.PortletResult.executeRenderResult(PortletResult.java:177)
  at
org.apache.struts2.portlet.result.PortletResult.doExecute(PortletResult.java:77)
  at
org.apache.struts2.dispatcher.StrutsResultSupport.execute(StrutsResultSupport.java:178)
..
Caused by: java.lang.NullPointerException
  at
org.apache.struts2.portlet.util.PortletUrlHelper.buildResourceUrl(PortletUrlHelper.java:200)
  at org.apache.struts2.components.URL.end(URL.java:260)
  at
org.apache.struts2.views.jsp.ComponentTagSupport.doEndTag(ComponentTagSupport.java:43)
..

Could this be caused by the portlet container?

Thanks.

Wanjun Wang



   
 "Nils-Helge Garli 
 Hegvik"   
 <[EMAIL PROTECTED]  To
 > "Struts Users Mailing List" 
   
 01/02/2008 02:34   cc
 PM
   Subject
   Re: IllegalStateException from  
 Please respond to org.apache.struts2.portlet.dispatch
   "Struts Users   er.Jsr168Dispatcher 
   Mailing List"   
 <[EMAIL PROTECTED] 
  he.org>  
   
   
   




I have never tested the execute and wait stuff, so I don't really know
how it works. But from reading the code for the interceptor, and
reading the stack trace, I would guess that this happens because the
default "wait" result is invoked and is not a result type that is
supported in a portlet. You could try configuring a result for "wait"
for the action explicitly. If you still have problems, please provide
the relevant configuration snippets.

Nils-H

On Jan 2, 2008 7:01 PM, Wanjun Wang <[EMAIL PROTECTED]> wrote:
> Hi,
>
> Has anyone used interceptor-ref in a portlet?  I'm trying to port the
> execute-and-wait showcase to a portlet.  The initial page displays fine,
> but upon submit, the following exception occurs:
>
> [1/2/08 11:49:34:468 EST] 002b EventQueueMan E
> com.ibm.wps.pe.pc.waspc.event.EventQueueManager processEventLoop
> EJPPG1122E: An error occurred during portlet event processing.
>  javax.portlet.PortletException: Error
> executing action longProcess3
>   at
>
org.apache.struts2.portlet.dispatcher.Jsr168Dispatcher.serviceAction(Jsr168Dispatcher.java:426)

>   at
>
org.apache.struts2.portlet.dispatcher.Jsr168Dispatcher.processAction(Jsr168Dispatcher.java:274)

> ..
> Caused by: java.lang.IllegalStateException: Not allowed in event phase
>   at
>
org.apache.struts2.portlet.servlet.PortletServletResponse.isCommitted(PortletServletResponse.java:177)

>   at
>
org.apache.struts2.dispatcher.ServletDispatcherResult.doExecute(ServletDis

Re: IllegalStateException from org.apache.struts2.portlet.dispatcher.Jsr168Dispatcher

2008-01-02 Thread Nils-Helge Garli Hegvik
I have never tested the execute and wait stuff, so I don't really know
how it works. But from reading the code for the interceptor, and
reading the stack trace, I would guess that this happens because the
default "wait" result is invoked and is not a result type that is
supported in a portlet. You could try configuring a result for "wait"
for the action explicitly. If you still have problems, please provide
the relevant configuration snippets.

Nils-H

On Jan 2, 2008 7:01 PM, Wanjun Wang <[EMAIL PROTECTED]> wrote:
> Hi,
>
> Has anyone used interceptor-ref in a portlet?  I'm trying to port the
> execute-and-wait showcase to a portlet.  The initial page displays fine,
> but upon submit, the following exception occurs:
>
> [1/2/08 11:49:34:468 EST] 002b EventQueueMan E
> com.ibm.wps.pe.pc.waspc.event.EventQueueManager processEventLoop
> EJPPG1122E: An error occurred during portlet event processing.
>  javax.portlet.PortletException: Error
> executing action longProcess3
>   at
> org.apache.struts2.portlet.dispatcher.Jsr168Dispatcher.serviceAction(Jsr168Dispatcher.java:426)
>   at
> org.apache.struts2.portlet.dispatcher.Jsr168Dispatcher.processAction(Jsr168Dispatcher.java:274)
> ..
> Caused by: java.lang.IllegalStateException: Not allowed in event phase
>   at
> org.apache.struts2.portlet.servlet.PortletServletResponse.isCommitted(PortletServletResponse.java:177)
>   at
> org.apache.struts2.dispatcher.ServletDispatcherResult.doExecute(ServletDispatcherResult.java:135)
>   at
> org.apache.struts2.dispatcher.StrutsResultSupport.execute(StrutsResultSupport.java:178)
>   at
> com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:348)
>   at
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:253)
>   at
> com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:221)
>   at
> com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)
>   at
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
>   at
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
>   at
> com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
>   at
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
>   at
> com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:150)
>   at
> org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:48)
>   at
> com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)
>   at
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
>   at
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
>   at
> com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
>   at
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
>   at
> com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:123)
>   at
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
>   at
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
>   at
> com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
>   at
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
>   at
> com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:167)
>   at
> com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)
>   at
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
>   at
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
>   at
> com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
>   at
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
>   at
> com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:105)
>   at
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
>   at
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
>   at
> com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
>   at
> com.opensymphony.xwork2.DefaultActionInvoc

IllegalStateException from org.apache.struts2.portlet.dispatcher.Jsr168Dispatcher

2008-01-02 Thread Wanjun Wang
Hi,

Has anyone used interceptor-ref in a portlet?  I'm trying to port the
execute-and-wait showcase to a portlet.  The initial page displays fine,
but upon submit, the following exception occurs:

[1/2/08 11:49:34:468 EST] 002b EventQueueMan E
com.ibm.wps.pe.pc.waspc.event.EventQueueManager processEventLoop
EJPPG1122E: An error occurred during portlet event processing.
 javax.portlet.PortletException: Error
executing action longProcess3
  at
org.apache.struts2.portlet.dispatcher.Jsr168Dispatcher.serviceAction(Jsr168Dispatcher.java:426)
  at
org.apache.struts2.portlet.dispatcher.Jsr168Dispatcher.processAction(Jsr168Dispatcher.java:274)
..
Caused by: java.lang.IllegalStateException: Not allowed in event phase
  at
org.apache.struts2.portlet.servlet.PortletServletResponse.isCommitted(PortletServletResponse.java:177)
  at
org.apache.struts2.dispatcher.ServletDispatcherResult.doExecute(ServletDispatcherResult.java:135)
  at
org.apache.struts2.dispatcher.StrutsResultSupport.execute(StrutsResultSupport.java:178)
  at
com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:348)
  at
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:253)
  at
com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:221)
  at
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)
  at
com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
  at
com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
  at
com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
  at
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
  at
com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:150)
  at
org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:48)
  at
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)
  at
com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
  at
com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
  at
com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
  at
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
  at
com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:123)
  at
com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
  at
com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
  at
com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
  at
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
  at
com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:167)
  at
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)
  at
com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
  at
com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
  at
com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
  at
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
  at
com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:105)
  at
com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
  at
com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
  at
com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
  at
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
  at
org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:83)
  at
com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
  at
com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
  at
com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
  at
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
  at
org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:207)
  at
com.opensymphony.xwork2.D