Hi Sem,

Taking a look into this, I was surprised to see that tapestry's request
does not have a getCookies() method
http://tapestry.apache.org/5.3/apidocs/org/apache/tapestry5/services/Request.html

Instead, the CookieSource has to go directly to the HttpServletRequest
https://github.com/apache/tapestry5/blob/a197470fc1e698ca713741150114543a3f30d25b/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/InternalModule.java#L205

Under the hood, tapestry-atmosphere uses tapestry-offline to which fools
tapestry into rendering templates by spoofing a Request and a Response. I
took the design decision NOT to mock HttpServletRequest and
HttpServletResponse but it seems that's now causing an error in Tynamo

I feel that we should add a getCookies() method to
org.apache.tapestry5.services.Request (this would be a breaking change).
If CookieSource could then invoke this it would fix your error.

I'm guessing that Howard has a reason for leaving this off the Request
object?

Another option is for tapestry-offline to override the CookieSource service
but this gets a bit messy.

Cheers,
Lance.


On 22 August 2014 16:44, Semen Vishniakov <vishnyako...@gmail.com> wrote:

> Hi all,
>
> I'm trying to intrgrate tapestry-atmosphere library in my project,
> where we already have tynamo conversation and tynamo security.
>
> The following exception is thrown, when I try to broadcast message:
>
> internal.PerRequestBroadcastFilterImpl -
> Error rendering ComponentEventParameters[page=Home
> component=Home:mainlayout.pushtarget event=notificationEvent]
> java.lang.RuntimeException: java.util.concurrent.ExecutionException:
> java.lang.NullPointerException
> at
> org.lazan.t5.offline.services.internal.OfflineComponentRendererImpl.doRender(OfflineComponentRendererImpl.java:124)
> at
> org.lazan.t5.offline.services.internal.OfflineComponentRendererImpl.renderComponent(OfflineComponentRendererImpl.java:83)
> at $OfflineComponentRenderer_e08b8b016e7.renderComponent(Unknown Source)
> at
> org.lazan.t5.atmosphere.services.internal.PerRequestBroadcastFilterImpl.filter(PerRequestBroadcastFilterImpl.java:56)
> at org.atmosphere.cpr.BroadcasterConfig.filter(BroadcasterConfig.java:483)
> at
> org.atmosphere.cpr.DefaultBroadcaster.perRequestFilter(DefaultBroadcaster.java:850)
> at
> org.atmosphere.cpr.DefaultBroadcaster.deliverPush(DefaultBroadcaster.java:740)
> at org.atmosphere.cpr.DefaultBroadcaster.push(DefaultBroadcaster.java:646)
> at
> org.atmosphere.cpr.DefaultBroadcaster.perRequestFilter(DefaultBroadcaster.java:850)
> at
> org.atmosphere.cpr.DefaultBroadcaster.deliverPush(DefaultBroadcaster.java:740)
> at org.atmosphere.cpr.DefaultBroadcaster.push(DefaultBroadcaster.java:646)
> at java.lang.Thread.run(Thread.java:744)
> Caused by: java.util.concurrent.ExecutionException:
> java.lang.NullPointerException
> at java.util.concurrent.FutureTask.report(FutureTask.java:122)
> at
> org.lazan.t5.offline.services.internal.OfflineComponentRendererImpl.doRender(OfflineComponentRendererImpl.java:122)
> ... 13 more
> Caused by: java.lang.NullPointerException
> at
> org.apache.tapestry5.internal.services.InternalModule$1.getCookies(InternalModule.java:163)
> at $CookieSource_e08b8b0171a.getCookies(Unknown Source)
> at
> org.apache.tapestry5.internal.services.CookiesImpl.readCookieValue(CookiesImpl.java:61)
> at $Cookies_e08b8b01719.readCookieValue(Unknown Source)
> at
> org.tynamo.conversations.services.ConversationManagerImpl.activateConversation(ConversationManagerImpl.java:73)
> at $ConversationManager_e08b8b01756.activateConversation(Unknown Source)
> at
> org.tynamo.conversations.services.RequestHandlerDecoratorImpl$1.advise(RequestHandlerDecoratorImpl.java:25)
> at
> org.apache.tapestry5.ioc.internal.util.InternalUtils$21.advise(InternalUtils.java:1455)
> at
> org.apache.tapestry5.internal.plastic.AbstractMethodInvocation.proceed(AbstractMethodInvocation.java:86)
> at $ComponentRequestHandler_e08b8b01757.handleComponentEvent(Unknown
> Source)
> at $ComponentRequestHandler_e08b8b0171d.handleComponentEvent(Unknown
> Source)
> at
> org.lazan.t5.offline.services.internal.OfflineComponentRendererImpl$1.invoke(OfflineComponentRendererImpl.java:112)
> at
> org.lazan.t5.offline.services.internal.OfflineComponentRendererImpl$1.invoke(OfflineComponentRendererImpl.java:100)
> at
> org.apache.tapestry5.ioc.internal.services.ParallelExecutorImpl$1.call(ParallelExecutorImpl.java:58)
> ... 4 more
>
>
> I checked cookies in this request and they are not empty. What could
> be the cause of this problem?
>
> Thanks,
> Sem
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>

Reply via email to