You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Craig McClanahan <cr...@apache.org> on 2006/06/14 19:57:59 UTC
Re: [shale] Backing view
On 6/14/06, Marty Phee <mp...@jump-technologies.com> wrote:
>
> Newbie,
>
> I'm using Shale with tiger.
>
> JSP, subscribe (example from somewhere) that does a save. All this
> works fine, but I made a change so that the return should send it to a
> "Success" page.
> <navigation-rule>
> <from-view-id>/subscribe.jsp</from-view-id>
> <navigation-case>
> <from-outcome>success</from-outcome>
> <to-view-id>/success.jsp</to-view-id>
> </navigation-case>
> </navigation-rule>
>
> I kept getting a 500 error:
> 12:11:39,292 ERROR [faces]:253 - Servlet.service() for servlet faces
> threw exception
> java.lang.IllegalStateException: No WebApplicationContext found: no
> ContextLoaderListener registered?
>
> I then created a Success bean
> @Bean(name="success", scope= Scope.SESSION)
> @View
> public class Success
> {
> }
>
> And then everything worked. Do I always need a View behind my jsp's or
> am I doing something wrong?
>
> @Bean(name="subscrHandler", scope = Scope.REQUEST)
> public class SubscriberHandler {
> @Value("#{subscribe}")
> private Subscriber subscriber;
>
> public void setSubscriber(Subscriber subscriber) {
> this.subscriber = subscriber;
> }
>
> public String saveSubscriber( ) {
> subscriber.save( );
> return "success";
> }
> }
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
It is supposed to always be optional to have a backing bean behind a JSP
view. Could you please post the entire stack trace for the
IllegalStateException you encountered?
Craig
Re: [shale] Backing view
Posted by Marty Phee <mp...@jump-technologies.com>.
I tried every permutation last night and couldn't get it to work without
the managed bean.
<f:view> included.
Thanks for the pointers. Seems to be with spring. I removed it and it
works now.
Craig McClanahan wrote:
> Comments interspersed below.
>
> On 6/14/06, Marty Phee <mp...@jump-technologies.com> wrote:
>>
>> Here you go. Again this is Shale with Tiger.
>>
>> 13:27:47,796 ERROR [faces]:253 - Servlet.service() for servlet faces
>> threw exception
>> java.lang.IllegalStateException: No WebApplicationContext found: no
>> ContextLoaderListener registered?
>> at
>>
>> org.springframework.web.jsf.FacesContextUtils.getRequiredWebApplicationContext
>>
>> (FacesContextUtils.java:78)
>> at
>>
>> org.springframework.web.jsf.DelegatingVariableResolver.getWebApplicationContext
>>
>> (DelegatingVariableResolver.java:134)
>> at
>> org.springframework.web.jsf.DelegatingVariableResolver.resolveVariable(
>> DelegatingVariableResolver.java:112)
>> at
>>
>> org.apache.shale.spring.WebApplicationContextVariableResolver.resolveVariable
>>
>> (WebApplicationContextVariableResolver.java:87)
>> at
>
>
> Hmm ... interesting that Spring is involved here too. Are you using the
> Spring integration to create managed beans from the Spring bean factory?
> I've tested Spring integration and Tiger-based managed beans
> separately, but
> never tried them together.
>
> org.apache.shale.view.faces.ViewViewHandler.setupViewController(
>> ViewViewHandler.java:285)
>> at
>> org.apache.shale.view.faces.ViewViewHandler.createView(
>> ViewViewHandler.java:130)
>> at
>> org.apache.shale.tiles.TilesViewHandler.createView(TilesViewHandler.java
>> :184)
>> at
>> org.apache.myfaces.application.NavigationHandlerImpl.handleNavigation(
>> NavigationHandlerImpl.java:145)
>> at
>> org.apache.shale.dialog.faces.DialogNavigationHandler.handleNavigation(
>> DialogNavigationHandler.java:196)
>> at
>> org.apache.myfaces.application.ActionListenerImpl.processAction(
>> ActionListenerImpl.java:84)
>> at javax.faces.component.UICommand.broadcast(UICommand.java:106)
>> at
>> javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:90)
>> at
>> javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:164)
>> at
>> org.apache.myfaces.lifecycle.LifecycleImpl.invokeApplication(
>> LifecycleImpl.java:316)
>> at
>> org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:86)
>>
>> at javax.faces.webapp.FacesServlet.service(FacesServlet.java:106)
>> at
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
>> ApplicationFilterChain.java:252)
>> at
>> org.apache.catalina.core.ApplicationFilterChain.doFilter(
>> ApplicationFilterChain.java:173)
>> at
>> org.apache.shale.faces.ShaleApplicationFilter.doFilter(
>> ShaleApplicationFilter.java:275)
>> at
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
>> ApplicationFilterChain.java:202)
>> at
>> org.apache.catalina.core.ApplicationFilterChain.doFilter(
>> ApplicationFilterChain.java:173)
>> at
>> org.apache.catalina.core.StandardWrapperValve.invoke(
>> StandardWrapperValve.java:213)
>> at
>> org.apache.catalina.core.StandardContextValve.invoke(
>> StandardContextValve.java:178)
>> at
>> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java
>> :126)
>> at
>> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java
>> :105)
>> at
>> org.apache.catalina.core.StandardEngineValve.invoke(
>> StandardEngineValve.java:107)
>> at
>> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java
>> :148)
>> at
>> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
>>
>> at
>>
>> org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection
>>
>> (Http11BaseProtocol.java:664)
>> at
>> org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(
>> PoolTcpEndpoint.java:527)
>> at
>> org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(
>> LeaderFollowerWorkerThread.java:80)
>> at
>> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(
>> ThreadPool.java:684)
>> at java.lang.Thread.run(Thread.java:595)
>>
>> Succes.jsp
>> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
>> <HTML>
>> <HEAD><TITLE>Rejected!</TITLE>
>> </HEAD>
>> <BODY>
>> <CENTER>
>> <TABLE BORDER=5>
>> <TR><TH CLASS="TITLE">Success!</TH></TR>
>> </TABLE>
>> <H2>You have been successfully registered.</H2>
>>
>> </CENTER>
>> </BODY></HTML>
>
>
> I notice that this page doesn't actually have any JSF components in it.
> Could you try an experiment and add <f:view/> (and the appropriate taglib
> directive) to make this into a JSF page?
>
> Craig
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: [shale] Backing view
Posted by Craig McClanahan <cr...@apache.org>.
Comments interspersed below.
On 6/14/06, Marty Phee <mp...@jump-technologies.com> wrote:
>
> Here you go. Again this is Shale with Tiger.
>
> 13:27:47,796 ERROR [faces]:253 - Servlet.service() for servlet faces
> threw exception
> java.lang.IllegalStateException: No WebApplicationContext found: no
> ContextLoaderListener registered?
> at
>
> org.springframework.web.jsf.FacesContextUtils.getRequiredWebApplicationContext
> (FacesContextUtils.java:78)
> at
>
> org.springframework.web.jsf.DelegatingVariableResolver.getWebApplicationContext
> (DelegatingVariableResolver.java:134)
> at
> org.springframework.web.jsf.DelegatingVariableResolver.resolveVariable(
> DelegatingVariableResolver.java:112)
> at
>
> org.apache.shale.spring.WebApplicationContextVariableResolver.resolveVariable
> (WebApplicationContextVariableResolver.java:87)
> at
Hmm ... interesting that Spring is involved here too. Are you using the
Spring integration to create managed beans from the Spring bean factory?
I've tested Spring integration and Tiger-based managed beans separately, but
never tried them together.
org.apache.shale.view.faces.ViewViewHandler.setupViewController(
> ViewViewHandler.java:285)
> at
> org.apache.shale.view.faces.ViewViewHandler.createView(
> ViewViewHandler.java:130)
> at
> org.apache.shale.tiles.TilesViewHandler.createView(TilesViewHandler.java
> :184)
> at
> org.apache.myfaces.application.NavigationHandlerImpl.handleNavigation(
> NavigationHandlerImpl.java:145)
> at
> org.apache.shale.dialog.faces.DialogNavigationHandler.handleNavigation(
> DialogNavigationHandler.java:196)
> at
> org.apache.myfaces.application.ActionListenerImpl.processAction(
> ActionListenerImpl.java:84)
> at javax.faces.component.UICommand.broadcast(UICommand.java:106)
> at
> javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:90)
> at
> javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:164)
> at
> org.apache.myfaces.lifecycle.LifecycleImpl.invokeApplication(
> LifecycleImpl.java:316)
> at
> org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:86)
> at javax.faces.webapp.FacesServlet.service(FacesServlet.java:106)
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
> ApplicationFilterChain.java:252)
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(
> ApplicationFilterChain.java:173)
> at
> org.apache.shale.faces.ShaleApplicationFilter.doFilter(
> ShaleApplicationFilter.java:275)
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
> ApplicationFilterChain.java:202)
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(
> ApplicationFilterChain.java:173)
> at
> org.apache.catalina.core.StandardWrapperValve.invoke(
> StandardWrapperValve.java:213)
> at
> org.apache.catalina.core.StandardContextValve.invoke(
> StandardContextValve.java:178)
> at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java
> :126)
> at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java
> :105)
> at
> org.apache.catalina.core.StandardEngineValve.invoke(
> StandardEngineValve.java:107)
> at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java
> :148)
> at
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
> at
>
> org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection
> (Http11BaseProtocol.java:664)
> at
> org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(
> PoolTcpEndpoint.java:527)
> at
> org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(
> LeaderFollowerWorkerThread.java:80)
> at
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(
> ThreadPool.java:684)
> at java.lang.Thread.run(Thread.java:595)
>
> Succes.jsp
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
> <HTML>
> <HEAD><TITLE>Rejected!</TITLE>
> </HEAD>
> <BODY>
> <CENTER>
> <TABLE BORDER=5>
> <TR><TH CLASS="TITLE">Success!</TH></TR>
> </TABLE>
> <H2>You have been successfully registered.</H2>
>
> </CENTER>
> </BODY></HTML>
I notice that this page doesn't actually have any JSF components in it.
Could you try an experiment and add <f:view/> (and the appropriate taglib
directive) to make this into a JSF page?
Craig
Re: [shale] Backing view
Posted by Marty Phee <mp...@jump-technologies.com>.
Done: http://issues.apache.org/struts/browse/SHALE-192
Craig McClanahan wrote:
> On 6/14/06, Marty Phee <mp...@jump-technologies.com> wrote:
>>
>> Removed spring and it works. Thanks for the pointer.
>>
>> So, if I use spring you must have managed beans for all JSP's? Not sure
>> if I"m actually going to use spring.
>
>
> It appears that this is the effective state of the current
> implementation.
> But I consider that a bug -- it should be possible to use this
> combination
> of stuff together, without any requirement that a view controller
> exist for
> each page. It would help us make sure this gets attention if you
> could file
> a bug report documenting your experiences with this, and then note the
> workaround (removing Spring) that made it work for you in the short term.
>
> http://issues.apache.org/struts/
>
> Craig
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: [shale] Backing view
Posted by Craig McClanahan <cr...@apache.org>.
On 6/14/06, Marty Phee <mp...@jump-technologies.com> wrote:
>
> Removed spring and it works. Thanks for the pointer.
>
> So, if I use spring you must have managed beans for all JSP's? Not sure
> if I"m actually going to use spring.
It appears that this is the effective state of the current implementation.
But I consider that a bug -- it should be possible to use this combination
of stuff together, without any requirement that a view controller exist for
each page. It would help us make sure this gets attention if you could file
a bug report documenting your experiences with this, and then note the
workaround (removing Spring) that made it work for you in the short term.
http://issues.apache.org/struts/
Craig
Wendy Smoak wrote:
> > On 6/14/06, Marty Phee <mp...@jump-technologies.com> wrote:
> >
> >> Here you go. Again this is Shale with Tiger.
> >>
> >> 13:27:47,796 ERROR [faces]:253 - Servlet.service() for servlet faces
> >> threw exception
> >> java.lang.IllegalStateException: No WebApplicationContext found: no
> >> ContextLoaderListener registered?
> > ...
> >>
> org.apache.shale.spring.WebApplicationContextVariableResolver.resolveVariable
> (WebApplicationContextVariableResolver.java:87)
> >>
> >
> > This looks similar to the problems a couple of other people have had
> > when they are not using Spring, but still include shale-spring.jar in
> > WEB-INF/lib.
> >
> > This might help:
> > <
> http://www.nabble.com/Re%3A-Shale-Clay%3A-Are-managed-beans-mandatory-in-xml-view--p1873169.html
> >
> >
> >
> > If you're not using Spring and Tiles, try removing the shale-spring
> > and shale-tiles jars from your application. (Assuming they're in
> > WEB-INF/lib now, but it looks like they are from the stack trace.)
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
Re: [shale] Backing view
Posted by Marty Phee <mp...@jump-technologies.com>.
Removed spring and it works. Thanks for the pointer.
So, if I use spring you must have managed beans for all JSP's? Not sure
if I"m actually going to use spring.
Wendy Smoak wrote:
> On 6/14/06, Marty Phee <mp...@jump-technologies.com> wrote:
>
>> Here you go. Again this is Shale with Tiger.
>>
>> 13:27:47,796 ERROR [faces]:253 - Servlet.service() for servlet faces
>> threw exception
>> java.lang.IllegalStateException: No WebApplicationContext found: no
>> ContextLoaderListener registered?
> ...
>> org.apache.shale.spring.WebApplicationContextVariableResolver.resolveVariable(WebApplicationContextVariableResolver.java:87)
>>
>
> This looks similar to the problems a couple of other people have had
> when they are not using Spring, but still include shale-spring.jar in
> WEB-INF/lib.
>
> This might help:
> <http://www.nabble.com/Re%3A-Shale-Clay%3A-Are-managed-beans-mandatory-in-xml-view--p1873169.html>
>
>
> If you're not using Spring and Tiles, try removing the shale-spring
> and shale-tiles jars from your application. (Assuming they're in
> WEB-INF/lib now, but it looks like they are from the stack trace.)
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: [shale] Backing view
Posted by Wendy Smoak <ws...@gmail.com>.
On 6/14/06, Marty Phee <mp...@jump-technologies.com> wrote:
> Here you go. Again this is Shale with Tiger.
>
> 13:27:47,796 ERROR [faces]:253 - Servlet.service() for servlet faces
> threw exception
> java.lang.IllegalStateException: No WebApplicationContext found: no
> ContextLoaderListener registered?
...
> org.apache.shale.spring.WebApplicationContextVariableResolver.resolveVariable(WebApplicationContextVariableResolver.java:87)
This looks similar to the problems a couple of other people have had
when they are not using Spring, but still include shale-spring.jar in
WEB-INF/lib.
This might help:
<http://www.nabble.com/Re%3A-Shale-Clay%3A-Are-managed-beans-mandatory-in-xml-view--p1873169.html>
If you're not using Spring and Tiles, try removing the shale-spring
and shale-tiles jars from your application. (Assuming they're in
WEB-INF/lib now, but it looks like they are from the stack trace.)
--
Wendy
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: [shale] Backing view
Posted by Marty Phee <mp...@jump-technologies.com>.
Here you go. Again this is Shale with Tiger.
13:27:47,796 ERROR [faces]:253 - Servlet.service() for servlet faces
threw exception
java.lang.IllegalStateException: No WebApplicationContext found: no
ContextLoaderListener registered?
at
org.springframework.web.jsf.FacesContextUtils.getRequiredWebApplicationContext(FacesContextUtils.java:78)
at
org.springframework.web.jsf.DelegatingVariableResolver.getWebApplicationContext(DelegatingVariableResolver.java:134)
at
org.springframework.web.jsf.DelegatingVariableResolver.resolveVariable(DelegatingVariableResolver.java:112)
at
org.apache.shale.spring.WebApplicationContextVariableResolver.resolveVariable(WebApplicationContextVariableResolver.java:87)
at
org.apache.shale.view.faces.ViewViewHandler.setupViewController(ViewViewHandler.java:285)
at
org.apache.shale.view.faces.ViewViewHandler.createView(ViewViewHandler.java:130)
at
org.apache.shale.tiles.TilesViewHandler.createView(TilesViewHandler.java:184)
at
org.apache.myfaces.application.NavigationHandlerImpl.handleNavigation(NavigationHandlerImpl.java:145)
at
org.apache.shale.dialog.faces.DialogNavigationHandler.handleNavigation(DialogNavigationHandler.java:196)
at
org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:84)
at javax.faces.component.UICommand.broadcast(UICommand.java:106)
at
javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:90)
at
javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:164)
at
org.apache.myfaces.lifecycle.LifecycleImpl.invokeApplication(LifecycleImpl.java:316)
at
org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:86)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:106)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at
org.apache.shale.faces.ShaleApplicationFilter.doFilter(ShaleApplicationFilter.java:275)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
at
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
at
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595)
Succes.jsp
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD><TITLE>Rejected!</TITLE>
</HEAD>
<BODY>
<CENTER>
<TABLE BORDER=5>
<TR><TH CLASS="TITLE">Success!</TH></TR>
</TABLE>
<H2>You have been successfully registered.</H2>
</CENTER>
</BODY></HTML>
>>
> It is supposed to always be optional to have a backing bean behind a JSP
> view. Could you please post the entire stack trace for the
> IllegalStateException you encountered?
>
> Craig
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org