The bug that caused the stack trace below was fixed in Tapestry 5.4, but not released yet. I don't know how a null value on onPassivate() could be related. Tapestry does handle null activation context values without any problems.

On Fri, 30 May 2014 16:58:25 -0300, Bogdan Ivascu <ivascu.bogdan...@gmail.com> wrote:

If anyone else is reading this, how I worked around this issue. The page in question had an "activate" method that took two parameters. Depending on
page context, it's sister "passivate" method would sometimes return null
for one of the array parameters. I made sure this never happened by
checking the parameters for null in onPassivate and adding string markers
instead.

Bogdan.


On Wed, May 28, 2014 at 4:46 PM, Thiago H de Paula Figueiredo <
thiag...@gmail.com> wrote:

That's an unrelated but known issue.


On Wed, 28 May 2014 17:42:19 -0300, Bogdan Ivascu <
ivascu.bogdan...@gmail.com> wrote:

An interesting issue with the atmos library. I put the webSocket code in
my
Layout component and there are no issues when I navigate about between
pages that wrap themselves in this layout. I do encounter a NullPointer
when this Layout contains another Layout and then the page. To be more
clear: MainPagesLayout -> MemberHomePage: works nicely. MainPagesLayout ->
EmailLayout -> EmailInboxPage: throws NullPointer exception.

Stack below in case anyone has the time to look at it:

2014-May-28 16:31:36 internal.services.DefaultRequestExceptionHandler
java.lang.NullPointerException
    at org.apache.tapestry5.json.JSONObject.printValue(
JSONObject.java:887)
    at org.apache.tapestry5.json.JSONArray.print(JSONArray.java:436)
    at org.apache.tapestry5.json.JSONObject.printValue(
JSONObject.java:859)
    at org.apache.tapestry5.json.JSONObject.print(JSONObject.java:830)
    at org.apache.tapestry5.json.JSONObject.printValue(
JSONObject.java:853)
    at org.apache.tapestry5.json.JSONArray.print(JSONArray.java:436)
    at org.apache.tapestry5.json.JSONObject.printValue(
JSONObject.java:859)
    at org.apache.tapestry5.json.JSONObject.print(JSONObject.java:830)
    at
org.apache.tapestry5.json.JSONCollection.toString(JSONCollection.java:47)
    at
org.apache.tapestry5.json.JSONCollection.toString(JSONCollection.java:63)
    at
org.apache.tapestry5.internal.services.DocumentLinkerImpl.
add(DocumentLinkerImpl.java:228)
    at
org.apache.tapestry5.internal.services.DocumentLinkerImpl.
add(DocumentLinkerImpl.java:219)
    at
org.apache.tapestry5.internal.services.DocumentLinkerImpl.
addDynamicScriptBlock(DocumentLinkerImpl.java:204)
    at
org.apache.tapestry5.internal.services.DocumentLinkerImpl.
addScriptElements(DocumentLinkerImpl.java:158)
    at
org.apache.tapestry5.internal.services.DocumentLinkerImpl.updateDocument(
DocumentLinkerImpl.java:123)
    at
org.apache.tapestry5.services.TapestryModule$25.
renderMarkup(TapestryModule.java:1898)
    at $MarkupRenderer_7643a5097d2.renderMarkup(Unknown Source)
    at $MarkupRenderer_7643a5097cd.renderMarkup(Unknown Source)
    at
org.apache.tapestry5.internal.services.PageMarkupRendererImpl.
renderPageMarkup(PageMarkupRendererImpl.java:47)
    at $PageMarkupRenderer_7643a5097cb.renderPageMarkup(Unknown Source)
    at
org.apache.tapestry5.internal.services.PageResponseRendererImpl.
renderPageResponse(PageResponseRendererImpl.java:67)
    at $PageResponseRenderer_7643a5097c7.renderPageResponse(Unknown
Source)
    at
org.apache.tapestry5.internal.services.PageRenderRequestHandlerImpl.
handle(PageRenderRequestHandlerImpl.java:64)
    at
org.apache.tapestry5.services.TapestryModule$38.handle(
TapestryModule.java:2222)
    at $PageRenderRequestHandler_7643a5097c9.handle(Unknown Source)
    at $PageRenderRequestHandler_7643a509765.handle(Unknown Source)
    at
org.apache.tapestry5.internal.services.ComponentRequestHandlerTermina
tor.handlePageRender(ComponentRequestHandlerTerminator.java:48)
    at
org.apache.tapestry5.services.InitializeActivePageName.handlePageRender(
InitializeActivePageName.java:47)
    at $ComponentRequestHandler_7643a509766.handlePageRender(Unknown
Source)
    at
com.ar.model.security.AdminProtectionFilter.handlePageRender(
AdminProtectionFilter.java:54)
    at $ComponentRequestFilter_7643a509763.handlePageRender(Unknown
Source)
    at $ComponentRequestHandler_7643a509766.handlePageRender(Unknown
Source)
    at
com.ar.model.security.PageProtectionFilter.handlePageRender(
PageProtectionFilter.java:53)
    at $ComponentRequestFilter_7643a509762.handlePageRender(Unknown
Source)
    at $ComponentRequestHandler_7643a509766.handlePageRender(Unknown
Source)
    at
org.lazan.t5.atmosphere.services.internal.PageGlobalsComponentRequestFil
ter.handlePageRender(PageGlobalsComponentRequestFilter.java:28)
    at $ComponentRequestHandler_7643a509766.handlePageRender(Unknown
Source)
    at $ComponentRequestHandler_7643a50972c.handlePageRender(Unknown
Source)
    at
org.apache.tapestry5.internal.services.PageRenderDispatcher.
dispatch(PageRenderDispatcher.java:45)
    at $Dispatcher_7643a50972f.dispatch(Unknown Source)
    at $Dispatcher_7643a509729.dispatch(Unknown Source)
    at
org.apache.tapestry5.services.TapestryModule$RequestHandlerTerminator.
service(TapestryModule.java:302)
    at
org.apache.tapestry5.internal.services.RequestErrorFilter.
service(RequestErrorFilter.java:26)
    at $RequestHandler_7643a50972a.service(Unknown Source)
    at
org.apache.tapestry5.services.TapestryModule$3.service(
TapestryModule.java:902)
    at $RequestHandler_7643a50972a.service(Unknown Source)
    at
org.apache.tapestry5.services.TapestryModule$2.service(
TapestryModule.java:892)
    at $RequestHandler_7643a50972a.service(Unknown Source)
    at
org.apache.tapestry5.internal.services.StaticFilesFilter.
service(StaticFilesFilter.java:90)
    at $RequestHandler_7643a50972a.service(Unknown Source)
    at com.ar.services.AppModule$1.service(AppModule.java:137)
    at $RequestFilter_7643a509724.service(Unknown Source)
    at $RequestHandler_7643a50972a.service(Unknown Source)
    at
org.apache.tapestry5.internal.services.CheckForUpdatesFilter$2.
invoke(CheckForUpdatesFilter.java:105)
    at
org.apache.tapestry5.internal.services.CheckForUpdatesFilter$2.
invoke(CheckForUpdatesFilter.java:95)
    at
org.apache.tapestry5.ioc.internal.util.ConcurrentBarrier.withRead(
ConcurrentBarrier.java:85)
    at
org.apache.tapestry5.internal.services.CheckForUpdatesFilter.service(
CheckForUpdatesFilter.java:119)
    at $RequestHandler_7643a50972a.service(Unknown Source)
    at $RequestHandler_7643a50971d.service(Unknown Source)
    at
org.apache.tapestry5.services.TapestryModule$
HttpServletRequestHandlerTerminator.service(TapestryModule.java:253)
    at
org.apache.tapestry5.internal.gzip.GZipFilter.service(GZipFilter.java:53)
    at $HttpServletRequestHandler_7643a50971f.service(Unknown Source)
    at
org.apache.tapestry5.upload.internal.services.
MultipartServletRequestFilter.service(MultipartServletRequestFilter.
java:44)
    at $HttpServletRequestHandler_7643a50971f.service(Unknown Source)
    at
org.apache.tapestry5.internal.services.IgnoredPathsFilter.
service(IgnoredPathsFilter.java:62)
    at $HttpServletRequestFilter_7643a50971b.service(Unknown Source)
    at $HttpServletRequestHandler_7643a50971f.service(Unknown Source)
    at
org.lazan.t5.atmosphere.services.internal.HttpServletHttpServletRequestF
ilter.service(HttpServletHttpServletRequestFilter.java:72)
    at
org.lazan.t5.atmosphere.services.internal.AtmosphereHttpServletRequestFi
lter.service(AtmosphereHttpServletRequestFilter.java:50)
    at $HttpServletRequestHandler_7643a50971f.service(Unknown Source)
    at
org.apache.tapestry5.services.TapestryModule$1.service(
TapestryModule.java:852)
    at $HttpServletRequestHandler_7643a50971f.service(Unknown Source)
    at $HttpServletRequestHandler_7643a509719.service(Unknown Source)
    at org.apache.tapestry5.TapestryFilter.doFilter(
TapestryFilter.java:171)
    at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.
doFilter(ServletHandler.java:1212)
    at
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:399)
    at
org.mortbay.jetty.security.SecurityHandler.handle(
SecurityHandler.java:216)
    at
org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
    at
org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:766)
    at org.mortbay.jetty.webapp.WebAppContext.handle(
WebAppContext.java:450)
    at
org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
    at org.mortbay.jetty.Server.handle(Server.java:326)
    at
org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
    at
org.mortbay.jetty.HttpConnection$RequestHandler.
headerComplete(HttpConnection.java:928)
    at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:549)
    at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
    at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
    at
org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:
410)
    at
org.mortbay.thread.QueuedThreadPool$PoolThread.
run(QueuedThreadPool.java:582)


Bogdan.




On Wed, May 21, 2014 at 3:33 AM, Lance Java <lance.j...@googlemail.com>
wrote:

 I've implemented this feature in tapestry-cometd but it's not been
implemented in tapestry-atmosphere yet. I think it's only a couple of
lines
of javascript.

I have just updated the outstanding issue with a possible solution here:
https://github.com/uklance/tapestry-atmosphere/issues/5

Pull requests welcomed!!
On 21 May 2014 04:21, "Bogdan Ivascu" <ivascu.bogdan...@gmail.com>
wrote:

> I ended up using your atmosphere implementation and it works like a
charm,
> so many thanks for that. I have an additional questions though. When
> returning the block to the client, basically your ChatDemo class
> (
>
>
https://github.com/uklance/tapestry-atmosphere/blob/
master/tapestry-atmosphere-demo/src/main/java/org/lazan/
t5/atmosphere/demo/pages/ChatDemo.java#L65
> )
> ->onChatMessage  method, I want to be able to execute some client
> javascript
> that will parse a Long number and make it into a date using momentjs.
Where
> can I patch in this piece of code? I tried changing the return type of
the
> method to void and using AjaxRespRenderer to display the block and then > call the javascript without much success. What would be a good solution
> here, listen on the client side for some event to be triggered or
somehow
> make an ajax addScript() call from the server.
>
> Thanks,
> Bogdan.
>
>
> On Tue, May 13, 2014 at 12:15 PM, Bogdan Ivascu
> <ivascu.bogdan...@gmail.com>wrote:
>
> > Hi Lance,
> > I did see numerous discussions around your implementation. My goal
here
> > is to try and get a better understanding of where and how this
framework
> > can be extended. I am however pressed for time and if I cannot get it
to
> > work, I will most likely end up using your implementation.
> >
> > Thanks,
> > Bogdan.
> >
> >
> > On Tue, May 13, 2014 at 3:34 AM, Lance Java <
lance.j...@googlemail.com
> >wrote:
> >
> >> Take a look at tapestry-atmosphere [1] and tapestry-cometd [2]
> >>
> >> [1] https://github.com/uklance/tapestry-atmosphere
> >> [2] https://github.com/uklance/tapestry-cometd
> >> On 13 May 2014 02:10, "Bogdan Ivascu" <ivascu.bogdan...@gmail.com>
> wrote:
> >>
> >> > Hi everyone,
> >> >   I want to add webSocket support for my tapestry project and
need a
> few
> >> > pointers. What I have is a dead simple Servlet, implementing the
java
> >> > WebSocket api. I would like to bring this servlet into my tapestry
> >> project
> >> > and have it managed by tapestry itself. To be more clear, I don't
want
> >> to
> >> > use the ignore path functionality to expose it, but rather have
> >> tapestry's
> >> > filter control the access to this servlet.
> >> >
> >> > The biggest problem that I have right now is that I don't have a
clear
> >> > understanding of what I need to do to make this happen. Will this
> >> servlet
> >> > be a service or a page with no tml, where would it sit, how do I
> >> configure
> >> > tapestry so that it knows to create a new instance for each
request.
> >> >
> >> > A nudge of where I could document myself regarding this type of
> >> integration
> >> > would be most welcome.
> >> >
> >> > Thank you,
> >> > Bogdan.
> >> >
> >>
> >
> >
>



--
Thiago H. de Paula Figueiredo
Tapestry, Java and Hibernate consultant and developer
http://machina.com.br


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




--
Thiago H. de Paula Figueiredo
Tapestry, Java and Hibernate consultant and developer
http://machina.com.br

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

Reply via email to