You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Jan Vissers <Ja...@cumquat.nl> on 2008/04/23 21:43:07 UTC

Re: T5 contributeMasterDispatcher - how to have default rootContext access be part of it

Great Peter,

This was indeed the problem. As I pointed out earlier - I use(d) Chris
great writeup on dispatchers on the wiki and also another follow up
article by
Stephane Decleire -
http://wiki.apache.org/tapestry/Tapestry5HowToControlAccess
Which contains the same anomaly.

Thx again,
-J.

>
> Sorry to jump in here Chris...  Jan not exactly sure what you are doing
> since you haven't shown your code, but the exception is telling you "the
> response has been committed" , which means you are trying to modify a
> Response that is being processed, i.e.: it is read only. If you
> interrupt the response, for example with a redirect, then try returning
> true.
>
> if(interruptHere)){
>      response.sendRedirect("/login");
>      return true;
> }
> return false;
>
> Peter
>
> Jan Vissers wrote:
>> Hi Chris,
>>
>> Thank you. As a matter of fact I used your wiki entries as my main
>> inspiration. So what I do now is:
>>
>> use: "before:RootPath" for the contributation and
>> return 'false' on the dispath for '/login and '/assets/'
>>
>> This works but in the background the following stuff is logged
>> (To be more precise I'm using an ASO in my dispatcher)
>>
>> Question is: should this worry me?
>>
>> [DEBUG] SecurityController In dispatch for /
>> [INFO] TimingFilter Request time: 1 ms
>> [ERROR] RequestExceptionHandler Processing of request failed with
>> uncaught exception: Cannot create a session after the response has been
>> committed
>> org.apache.tapestry.runtime.ComponentEventException: Cannot create a
>> session after the response has been committed
>> 	at
>> org.apache.tapestry.internal.structure.ComponentPageElementImpl.triggerContextEvent(ComponentPageElementImpl.java:1021)
>> 	at
>> org.apache.tapestry.internal.services.PageRenderRequestHandlerImpl.handle(PageRenderRequestHandlerImpl.java:52)
>> 	at org.apache.tapestry.services.TapestryModule
>> $29.handle(TapestryModule.java:1607)
>> 	at
>> $PageRenderRequestHandler_1197add4787.handle($PageRenderRequestHandler_1197add4787.java)
>> 	at
>> $PageRenderRequestHandler_1197add4779.handle($PageRenderRequestHandler_1197add4779.java)
>> 	at
>> org.apache.tapestry.internal.services.RootPathDispatcher.dispatch(RootPathDispatcher.java:61)
>> 	at $Dispatcher_1197add4781.dispatch($Dispatcher_1197add4781.java)
>> 	at $Dispatcher_1197add4772.dispatch($Dispatcher_1197add4772.java)
>> 	at org.apache.tapestry.services.TapestryModule
>> $13.service(TapestryModule.java:944)
>> 	at com.*****.lighting.guidecontrol.view.services.AppModule
>> $1.service(AppModule.java:83)
>> 	at $RequestFilter_1197add4771.service($RequestFilter_1197add4771.java)
>> 	at
>> $RequestHandler_1197add4773.service($RequestHandler_1197add4773.java)
>> 	at
>> org.apache.tapestry.internal.services.LocalizationFilter.service(LocalizationFilter.java:42)
>> 	at
>> $RequestHandler_1197add4773.service($RequestHandler_1197add4773.java)
>> 	at org.apache.tapestry.services.TapestryModule
>> $3.service(TapestryModule.java:553)
>> 	at
>> $RequestHandler_1197add4773.service($RequestHandler_1197add4773.java)
>> 	at org.apache.tapestry.services.TapestryModule
>> $2.service(TapestryModule.java:520)
>> 	at
>> $RequestHandler_1197add4773.service($RequestHandler_1197add4773.java)
>> 	at
>> org.apache.tapestry.internal.services.StaticFilesFilter.service(StaticFilesFilter.java:79)
>> 	at
>> $RequestHandler_1197add4773.service($RequestHandler_1197add4773.java)
>> 	at org.apache.tapestry.internal.services.CheckForUpdatesFilter
>> $2.invoke(CheckForUpdatesFilter.java:93)
>> 	at org.apache.tapestry.internal.services.CheckForUpdatesFilter
>> $2.invoke(CheckForUpdatesFilter.java:84)
>> 	at
>> org.apache.tapestry.ioc.internal.util.ConcurrentBarrier.withRead(ConcurrentBarrier.java:77)
>> 	at
>> org.apache.tapestry.internal.services.CheckForUpdatesFilter.service(CheckForUpdatesFilter.java:106)
>> 	at
>> $RequestHandler_1197add4773.service($RequestHandler_1197add4773.java)
>> 	at
>> $RequestHandler_1197add476a.service($RequestHandler_1197add476a.java)
>> 	at org.apache.tapestry.services.TapestryModule
>> $12.service(TapestryModule.java:924)
>> 	at
>> org.apache.tapestry.internal.services.IgnoredPathsFilter.service(IgnoredPathsFilter.java:62)
>> 	at
>> $HttpServletRequestFilter_1197add4769.service($HttpServletRequestFilter_1197add4769.java)
>> 	at
>> $HttpServletRequestHandler_1197add476b.service($HttpServletRequestHandler_1197add476b.java)
>> 	at
>> $HttpServletRequestHandler_1197add4768.service($HttpServletRequestHandler_1197add4768.java)
>> 	at org.apache.tapestry.TapestryFilter.doFilter(TapestryFilter.java:168)
>> 	at
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>> 	at
>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>> 	at
>> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
>> 	at
>> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
>> 	at
>> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
>> 	at
>> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
>> 	at
>> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
>> 	at
>> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
>> 	at
>> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
>> 	at org.apache.coyote.http11.Http11Protocol
>> $Http11ConnectionHandler.process(Http11Protocol.java:583)
>> 	at org.apache.tomcat.util.net.JIoEndpoint
>> $Worker.run(JIoEndpoint.java:447)
>> 	at java.lang.Thread.run(Thread.java:735)
>> Caused by:
>> java.lang.IllegalStateException: Cannot create a session after the
>> response has been committed
>> 	at
>> org.apache.catalina.connector.Request.doGetSession(Request.java:2301)
>> 	at org.apache.catalina.connector.Request.getSession(Request.java:2075)
>> 	at
>> org.apache.catalina.connector.RequestFacade.getSession(RequestFacade.java:833)
>> 	at
>> org.apache.tapestry.internal.services.RequestImpl.getSession(RequestImpl.java:88)
>> 	at $Request_1197add4783.getSession($Request_1197add4783.java)
>> 	at $Request_1197add475c.getSession($Request_1197add475c.java)
>> 	at
>> org.apache.tapestry.internal.services.SessionApplicationStatePersistenceStrategy.getSession(SessionApplicationStatePersistenceStrategy.java:42)
>> 	at
>> org.apache.tapestry.internal.services.SessionApplicationStatePersistenceStrategy.get(SessionApplicationStatePersistenceStrategy.java:48)
>> 	at org.apache.tapestry.internal.services.ApplicationStateManagerImpl
>> $ApplicationStateAdapter.getOrCreate(ApplicationStateManagerImpl.java:45)
>> 	at
>> org.apache.tapestry.internal.services.ApplicationStateManagerImpl.get(ApplicationStateManagerImpl.java:126)
>> 	at
>> $ApplicationStateManager_1197add4780.get($ApplicationStateManager_1197add4780.java)
>> 	at com.*****.lighting.guidecontrol.view.base.AbstractBasePage._
>> $read_breadCrumbHolder(AbstractBasePage.java)
>> 	at
>> com.*****.lighting.guidecontrol.view.base.AbstractBasePage.onActivate(AbstractBasePage.java:130)
>> 	at
>> com.*****.lighting.guidecontrol.view.base.AbstractBasePage.dispatchComponentEvent(AbstractBasePage.java)
>> 	at
>> org.apache.tapestry.internal.structure.ComponentPageElementImpl.dispatchEvent(ComponentPageElementImpl.java:843)
>> 	at
>> org.apache.tapestry.internal.structure.ComponentPageElementImpl.triggerContextEvent(ComponentPageElementImpl.java:1004)
>> 	... 43 more
>> [DEBUG] SecurityController In dispatch for /login
>> [DEBUG] AbstractBasePage Page initialization added to breadcrumbs:
>> login;jsessionid=278B5A7E10E6912784BE444C0CD885B1
>> [INFO] TimingFilter Request time: 6 ms
>>
>> -J.
>>
>> On Wed, 2008-04-23 at 12:32 +0200, Chris Lewis wrote:
>>
>>> Hi Jan,
>>>
>>> The first 2 paragraphs of this article cover what you want to do:
>>>
>>> http://wiki.apache.org/tapestry/Tapestry5HowToCreateADispatcher
>>>
>>> Included also are relevant links to javadocs, as well as references to
>>> the TapestryModule, where you can see how it influences dispatcher
>>> ordering.
>>>
>>> chris
>>>
>>> Jan Vissers wrote:
>>>
>>>> Hi,
>>>>
>>>> Just posted a question on dispatcher chain - but I think the subject
>>>> line was way to unclear - so sorry for asking the question again.
>>>>
>>>> I want all of my pages (also the one that is shown when I access root
>>>> context without anything - so no '/start') to be passed thru my
>>>> dispatcher. How can I do that?
>>>>
>>>> -J.
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>
>>>>
>>>>
>>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: T5 contributeMasterDispatcher - how to have default rootContext access be part of it

Posted by Chris Lewis <ch...@bellsouth.net>.
Peter,

Thanks fo jumping in :-) - I was away and I wouldn't have readily known
the answer anyway, so I along with Jan appreciate your sharing.

Jan,

So is there something incorrect in the wiki, or perhaps something that
would be worth adding as a warning?

chris

Jan Vissers wrote:
> Great Peter,
>
> This was indeed the problem. As I pointed out earlier - I use(d) Chris
> great writeup on dispatchers on the wiki and also another follow up
> article by
> Stephane Decleire -
> http://wiki.apache.org/tapestry/Tapestry5HowToControlAccess
> Which contains the same anomaly.
>
> Thx again,
> -J.
>
>   
>> Sorry to jump in here Chris...  Jan not exactly sure what you are doing
>> since you haven't shown your code, but the exception is telling you "the
>> response has been committed" , which means you are trying to modify a
>> Response that is being processed, i.e.: it is read only. If you
>> interrupt the response, for example with a redirect, then try returning
>> true.
>>
>> if(interruptHere)){
>>      response.sendRedirect("/login");
>>      return true;
>> }
>> return false;
>>
>> Peter
>>
>> Jan Vissers wrote:
>>     
>>> Hi Chris,
>>>
>>> Thank you. As a matter of fact I used your wiki entries as my main
>>> inspiration. So what I do now is:
>>>
>>> use: "before:RootPath" for the contributation and
>>> return 'false' on the dispath for '/login and '/assets/'
>>>
>>> This works but in the background the following stuff is logged
>>> (To be more precise I'm using an ASO in my dispatcher)
>>>
>>> Question is: should this worry me?
>>>
>>> [DEBUG] SecurityController In dispatch for /
>>> [INFO] TimingFilter Request time: 1 ms
>>> [ERROR] RequestExceptionHandler Processing of request failed with
>>> uncaught exception: Cannot create a session after the response has been
>>> committed
>>> org.apache.tapestry.runtime.ComponentEventException: Cannot create a
>>> session after the response has been committed
>>> 	at
>>> org.apache.tapestry.internal.structure.ComponentPageElementImpl.triggerContextEvent(ComponentPageElementImpl.java:1021)
>>> 	at
>>> org.apache.tapestry.internal.services.PageRenderRequestHandlerImpl.handle(PageRenderRequestHandlerImpl.java:52)
>>> 	at org.apache.tapestry.services.TapestryModule
>>> $29.handle(TapestryModule.java:1607)
>>> 	at
>>> $PageRenderRequestHandler_1197add4787.handle($PageRenderRequestHandler_1197add4787.java)
>>> 	at
>>> $PageRenderRequestHandler_1197add4779.handle($PageRenderRequestHandler_1197add4779.java)
>>> 	at
>>> org.apache.tapestry.internal.services.RootPathDispatcher.dispatch(RootPathDispatcher.java:61)
>>> 	at $Dispatcher_1197add4781.dispatch($Dispatcher_1197add4781.java)
>>> 	at $Dispatcher_1197add4772.dispatch($Dispatcher_1197add4772.java)
>>> 	at org.apache.tapestry.services.TapestryModule
>>> $13.service(TapestryModule.java:944)
>>> 	at com.*****.lighting.guidecontrol.view.services.AppModule
>>> $1.service(AppModule.java:83)
>>> 	at $RequestFilter_1197add4771.service($RequestFilter_1197add4771.java)
>>> 	at
>>> $RequestHandler_1197add4773.service($RequestHandler_1197add4773.java)
>>> 	at
>>> org.apache.tapestry.internal.services.LocalizationFilter.service(LocalizationFilter.java:42)
>>> 	at
>>> $RequestHandler_1197add4773.service($RequestHandler_1197add4773.java)
>>> 	at org.apache.tapestry.services.TapestryModule
>>> $3.service(TapestryModule.java:553)
>>> 	at
>>> $RequestHandler_1197add4773.service($RequestHandler_1197add4773.java)
>>> 	at org.apache.tapestry.services.TapestryModule
>>> $2.service(TapestryModule.java:520)
>>> 	at
>>> $RequestHandler_1197add4773.service($RequestHandler_1197add4773.java)
>>> 	at
>>> org.apache.tapestry.internal.services.StaticFilesFilter.service(StaticFilesFilter.java:79)
>>> 	at
>>> $RequestHandler_1197add4773.service($RequestHandler_1197add4773.java)
>>> 	at org.apache.tapestry.internal.services.CheckForUpdatesFilter
>>> $2.invoke(CheckForUpdatesFilter.java:93)
>>> 	at org.apache.tapestry.internal.services.CheckForUpdatesFilter
>>> $2.invoke(CheckForUpdatesFilter.java:84)
>>> 	at
>>> org.apache.tapestry.ioc.internal.util.ConcurrentBarrier.withRead(ConcurrentBarrier.java:77)
>>> 	at
>>> org.apache.tapestry.internal.services.CheckForUpdatesFilter.service(CheckForUpdatesFilter.java:106)
>>> 	at
>>> $RequestHandler_1197add4773.service($RequestHandler_1197add4773.java)
>>> 	at
>>> $RequestHandler_1197add476a.service($RequestHandler_1197add476a.java)
>>> 	at org.apache.tapestry.services.TapestryModule
>>> $12.service(TapestryModule.java:924)
>>> 	at
>>> org.apache.tapestry.internal.services.IgnoredPathsFilter.service(IgnoredPathsFilter.java:62)
>>> 	at
>>> $HttpServletRequestFilter_1197add4769.service($HttpServletRequestFilter_1197add4769.java)
>>> 	at
>>> $HttpServletRequestHandler_1197add476b.service($HttpServletRequestHandler_1197add476b.java)
>>> 	at
>>> $HttpServletRequestHandler_1197add4768.service($HttpServletRequestHandler_1197add4768.java)
>>> 	at org.apache.tapestry.TapestryFilter.doFilter(TapestryFilter.java:168)
>>> 	at
>>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>>> 	at
>>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>>> 	at
>>> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
>>> 	at
>>> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
>>> 	at
>>> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
>>> 	at
>>> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
>>> 	at
>>> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
>>> 	at
>>> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
>>> 	at
>>> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
>>> 	at org.apache.coyote.http11.Http11Protocol
>>> $Http11ConnectionHandler.process(Http11Protocol.java:583)
>>> 	at org.apache.tomcat.util.net.JIoEndpoint
>>> $Worker.run(JIoEndpoint.java:447)
>>> 	at java.lang.Thread.run(Thread.java:735)
>>> Caused by:
>>> java.lang.IllegalStateException: Cannot create a session after the
>>> response has been committed
>>> 	at
>>> org.apache.catalina.connector.Request.doGetSession(Request.java:2301)
>>> 	at org.apache.catalina.connector.Request.getSession(Request.java:2075)
>>> 	at
>>> org.apache.catalina.connector.RequestFacade.getSession(RequestFacade.java:833)
>>> 	at
>>> org.apache.tapestry.internal.services.RequestImpl.getSession(RequestImpl.java:88)
>>> 	at $Request_1197add4783.getSession($Request_1197add4783.java)
>>> 	at $Request_1197add475c.getSession($Request_1197add475c.java)
>>> 	at
>>> org.apache.tapestry.internal.services.SessionApplicationStatePersistenceStrategy.getSession(SessionApplicationStatePersistenceStrategy.java:42)
>>> 	at
>>> org.apache.tapestry.internal.services.SessionApplicationStatePersistenceStrategy.get(SessionApplicationStatePersistenceStrategy.java:48)
>>> 	at org.apache.tapestry.internal.services.ApplicationStateManagerImpl
>>> $ApplicationStateAdapter.getOrCreate(ApplicationStateManagerImpl.java:45)
>>> 	at
>>> org.apache.tapestry.internal.services.ApplicationStateManagerImpl.get(ApplicationStateManagerImpl.java:126)
>>> 	at
>>> $ApplicationStateManager_1197add4780.get($ApplicationStateManager_1197add4780.java)
>>> 	at com.*****.lighting.guidecontrol.view.base.AbstractBasePage._
>>> $read_breadCrumbHolder(AbstractBasePage.java)
>>> 	at
>>> com.*****.lighting.guidecontrol.view.base.AbstractBasePage.onActivate(AbstractBasePage.java:130)
>>> 	at
>>> com.*****.lighting.guidecontrol.view.base.AbstractBasePage.dispatchComponentEvent(AbstractBasePage.java)
>>> 	at
>>> org.apache.tapestry.internal.structure.ComponentPageElementImpl.dispatchEvent(ComponentPageElementImpl.java:843)
>>> 	at
>>> org.apache.tapestry.internal.structure.ComponentPageElementImpl.triggerContextEvent(ComponentPageElementImpl.java:1004)
>>> 	... 43 more
>>> [DEBUG] SecurityController In dispatch for /login
>>> [DEBUG] AbstractBasePage Page initialization added to breadcrumbs:
>>> login;jsessionid=278B5A7E10E6912784BE444C0CD885B1
>>> [INFO] TimingFilter Request time: 6 ms
>>>
>>> -J.
>>>
>>> On Wed, 2008-04-23 at 12:32 +0200, Chris Lewis wrote:
>>>
>>>       
>>>> Hi Jan,
>>>>
>>>> The first 2 paragraphs of this article cover what you want to do:
>>>>
>>>> http://wiki.apache.org/tapestry/Tapestry5HowToCreateADispatcher
>>>>
>>>> Included also are relevant links to javadocs, as well as references to
>>>> the TapestryModule, where you can see how it influences dispatcher
>>>> ordering.
>>>>
>>>> chris
>>>>
>>>> Jan Vissers wrote:
>>>>
>>>>         
>>>>> Hi,
>>>>>
>>>>> Just posted a question on dispatcher chain - but I think the subject
>>>>> line was way to unclear - so sorry for asking the question again.
>>>>>
>>>>> I want all of my pages (also the one that is shown when I access root
>>>>> context without anything - so no '/start') to be passed thru my
>>>>> dispatcher. How can I do that?
>>>>>
>>>>> -J.
>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>           
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>
>>>
>>>       
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>>     
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
>   

-- 
http://thegodcode.net