You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Erik Mellegård <er...@jeeves.se> on 2008/08/22 08:53:13 UTC
Struts2 & spring 2.5 in portlet
Hi,
I'v just started to implement a portlet application using struts2-portlet-plugin
and struts2-spring plugin. To manage my objects I'm planning to use spring 2.5. My
problem starts when using the scopes "session" and "request" on my spring managed beans.
I get the following error despite configurating RequestContextListener in web.xml:
13:57:50,724 ERROR [jsp:52] java.lang.IllegalStateException: No thread-bound request found: Are you referring to request attributes outside of an actual web request, or processing a request outside of the originally receiving thread? If you are actually operating within a web request and still receive this message, your code is probably running outside of DispatcherServlet/DispatcherPortlet: In this case, use RequestContextListener or RequestContextFilter to expose the current request.
at com.opensymphony.xwork2.spring.SpringObjectFactory.buildBean(SpringObjectFactory.java:126)
at com.opensymphony.xwork2.ObjectFactory.buildBean(ObjectFactory.java:143)
at com.opensymphony.xwork2.ObjectFactory.buildAction(ObjectFactory.java:113)
at com.opensymphony.xwork2.DefaultActionInvocation.createAction(DefaultActionInvocation.java:275)
at com.opensymphony.xwork2.DefaultActionInvocation.init(DefaultActionInvocation.java:365)
at com.opensymphony.xwork2.DefaultActionInvocation.access$000(DefaultActionInvocation.java:38)
at com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:83)
at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
at com.opensymphony.xwork2.DefaultActionInvocation.<init>(DefaultActionInvocation.java:74)
at com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:189)
at org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:41)
at org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:34)
at org.apache.struts2.portlet.dispatcher.Jsr168Dispatcher.serviceAction(Jsr168Dispatcher.java:415)
at org.apache.struts2.portlet.dispatcher.Jsr168Dispatcher.render(Jsr168Dispatcher.java:299)
at com.sun.portal.portletcontainer.appengine.filter.FilterChainImpl.doFilter(FilterChainImpl.java:121)
at com.liferay.portal.kernel.portlet.PortletFilterUtil.doFilter(PortletFilterUtil.java:69)
at com.liferay.portal.kernel.servlet.PortletServlet.service(PortletServlet.java:96)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
Am I missing something? Doesn't the struts2-spring plugin work within a portal
environment? When running in a web application it works, and when changing my
beans scope to "factory" socpe my configuration work in the portal.
Best regards
Erik Mellegård
Re: Struts2 & spring 2.5 in portlet
Posted by John H Liptak <Jo...@qwest.com>.
I would start with
http://weblogs.java.net/blog/felipeal/archive/2008/03/spring_icefaces.html
http://weblogs.java.net/blog/felipeal/archive/2008/03/spring_icefaces.html
--
View this message in context: http://www.nabble.com/Struts2---spring-2.5-in-portlet-tp19102346p19107333.html
Sent from the Struts - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Struts2 & spring 2.5 in portlet
Posted by Nils-Helge Garli Hegvik <ni...@gmail.com>.
If it should work with a regular portlet, then it should also work
with the Struts 2 portlet plugin. There's nothing special happening
inside the framework that should prevent this. You'd probably be
better off asking the question on a Spring or a Liferay mailing list.
Maybe this [1] thread is relevant?
Nils-H
[1] - http://www.liferay.com/web/guest/community/forums?p_p_id=19&p_p_lifecycle=0&p_p_state=normal&p_p_mode=view&_19_struts_action=%2Fmessage_boards%2Fview_message&_19_messageId=347191
On Fri, Aug 22, 2008 at 8:53 AM, Erik Mellegård
<er...@jeeves.se> wrote:
> Hi,
> I'v just started to implement a portlet application using struts2-portlet-plugin
> and struts2-spring plugin. To manage my objects I'm planning to use spring 2.5. My
> problem starts when using the scopes "session" and "request" on my spring managed beans.
> I get the following error despite configurating RequestContextListener in web.xml:
>
> 13:57:50,724 ERROR [jsp:52] java.lang.IllegalStateException: No thread-bound request found: Are you referring to request attributes outside of an actual web request, or processing a request outside of the originally receiving thread? If you are actually operating within a web request and still receive this message, your code is probably running outside of DispatcherServlet/DispatcherPortlet: In this case, use RequestContextListener or RequestContextFilter to expose the current request.
> at com.opensymphony.xwork2.spring.SpringObjectFactory.buildBean(SpringObjectFactory.java:126)
> at com.opensymphony.xwork2.ObjectFactory.buildBean(ObjectFactory.java:143)
> at com.opensymphony.xwork2.ObjectFactory.buildAction(ObjectFactory.java:113)
> at com.opensymphony.xwork2.DefaultActionInvocation.createAction(DefaultActionInvocation.java:275)
> at com.opensymphony.xwork2.DefaultActionInvocation.init(DefaultActionInvocation.java:365)
> at com.opensymphony.xwork2.DefaultActionInvocation.access$000(DefaultActionInvocation.java:38)
> at com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:83)
> at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
> at com.opensymphony.xwork2.DefaultActionInvocation.<init>(DefaultActionInvocation.java:74)
> at com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:189)
> at org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:41)
> at org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:34)
> at org.apache.struts2.portlet.dispatcher.Jsr168Dispatcher.serviceAction(Jsr168Dispatcher.java:415)
> at org.apache.struts2.portlet.dispatcher.Jsr168Dispatcher.render(Jsr168Dispatcher.java:299)
> at com.sun.portal.portletcontainer.appengine.filter.FilterChainImpl.doFilter(FilterChainImpl.java:121)
> at com.liferay.portal.kernel.portlet.PortletFilterUtil.doFilter(PortletFilterUtil.java:69)
> at com.liferay.portal.kernel.servlet.PortletServlet.service(PortletServlet.java:96)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
> at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>
> Am I missing something? Doesn't the struts2-spring plugin work within a portal
> environment? When running in a web application it works, and when changing my
> beans scope to "factory" socpe my configuration work in the portal.
>
> Best regards
> Erik Mellegård
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org