Quantcast

"No thread-bound request found" with Atmosphere

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

"No thread-bound request found" with Atmosphere

GeoffM
I'm attempting to update a list.gsp using ajaxpush (long polling) with Atmosphere. All seems well (suspend, broadcast, resume) and the page <div> gets updated when simple html strings are pushed back. However, attempting to use gsp templating to create html snippets produces the "No thread-bound request found" error.

After googling this error message - the problem seems to be because the suspended ajax request hits the AtmosphereServlet and not the GrailsDispatcherServlet and attempts to use render in it's various forms - def myHTML = g.render(template:'myTemplate', model:[myList: book.listOrderByAuthor( order:"desc" )]).

Is there anyway way to use the render template engine in this situation ?

Thanks for any help ........... Geoff
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: "No thread-bound request found" with Atmosphere

burtbeckwith
You could add an OpenSessionInViewFilter to web.xml that filters just these requests. It'll start a Hibernate Session and keep it open for the duration of the request. Grails does the same thing, although it uses a Webflow-aware subclass of OpenSessionInViewInterceptor.

Burt

>
> I'm attempting to update a list.gsp using ajaxpush (long polling) with
> Atmosphere. All seems well (suspend, broadcast, resume) and the page <div>
> gets updated when simple html strings are pushed back. However, attempting
> to use gsp templating to create html snippets produces the "No thread-bound
> request found" error.
>
> After googling this error message - the problem seems to be because the
> suspended ajax request hits the AtmosphereServlet and not the
> GrailsDispatcherServlet and attempts to use render in it's various forms -
> def myHTML = g.render(template:'myTemplate', model:[myList:
> book.listOrderByAuthor( order:"desc" )]).
>
> Is there anyway way to use the render template engine in this situation ?
>
> Thanks for any help ........... Geoff
>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: "No thread-bound request found" with Atmosphere

GeoffM
Thanks for your reply Bert. Can you explain this a bit further - are you suggesting that this is a Hibernate issue - where the model data can't be obtained? I thought the problem was to do with render engine not being bound to the correct request context.

- Geoff
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: "No thread-bound request found" with Atmosphere

Ian Roberts
GeoffM wrote:
> Thanks for your reply Bert. Can you explain this a bit further - are you
> suggesting that this is a Hibernate issue - where the model data can't be
> obtained? I thought the problem was to do with render engine not being bound
> to the correct request context.

If the latter, then a possible fix would be to add

  <listener>
    <listener-class>
      org.springframework.web.context.request.RequestContextListener
    </listener-class>
  </listener>

to your web.xml.  I remember having to do this in the past to get scoped
services to work with GWT RPC (it isn't necessary with the latest GWT
plugin as that routes RPC cals through the normal dispatcher servlet,
but previous versions used a custom servlet instead).

Ian


--
Ian Roberts               | Department of Computer Science
[hidden email]  | University of Sheffield, UK

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: "No thread-bound request found" with Atmosphere

smaldini
In reply to this post by GeoffM
Just a parenthesis, I will release next week in parallel of ICEsoft a plugin called ICEpush which solves this kind of trouble on long polling requests.
Closed!

On Wed, Apr 7, 2010 at 6:18 PM, GeoffM <[hidden email]> wrote:

Thanks for your reply Bert. Can you explain this a bit further - are you
suggesting that this is a Hibernate issue - where the model data can't be
obtained? I thought the problem was to do with render engine not being bound
to the correct request context.

- Geoff
--
View this message in context: http://n4.nabble.com/No-thread-bound-request-found-with-Atmosphere-tp1754210p1754597.html
Sent from the Grails - user mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email





--
Stéphane MALDINI
doc4web consultant
[hidden email]
--
http://fr.linkedin.com/in/smaldini
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: "No thread-bound request found" with Atmosphere

GeoffM
This sounds interesting - so a grails ICEpush plugin that supports .gsp will be available next week ? Are there any constraints eg Servlet 3.0 containers only ....... ?

Thanks for your reply ..........Geoff
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: "No thread-bound request found" with Atmosphere

GeoffM
In reply to this post by Ian Roberts
Ian, thanks for your reply. I attempted using RequestContextListener / RequestContextHolder to get the requestAttributes - but without success. Do you have any examples that demo this binding ?

Many thanks ........... Geoff
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: "No thread-bound request found" with Atmosphere

smaldini
In reply to this post by GeoffM
Geoff, ICEpush will adapt to your server : Glassfish, Servlet3 will be exploited but this is also Servlet 2.3+ compliant.

Good luck with your trouble. I think you could solve it by manually managing your session :

Domainclass.withSession { session->

//work

}

On Wed, Apr 7, 2010 at 8:42 PM, GeoffM <[hidden email]> wrote:

This sounds interesting - so a grails ICEpush plugin that supports .gsp will
be available next week ? Are there any constraints eg Servlet 3.0 containers
only ....... ?

Thanks for your reply ..........Geoff
--
View this message in context: http://n4.nabble.com/No-thread-bound-request-found-with-Atmosphere-tp1754210p1754787.html
Sent from the Grails - user mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email





--
Stéphane MALDINI
doc4web consultant
[hidden email]
--
http://fr.linkedin.com/in/smaldini
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: "No thread-bound request found" with Atmosphere

burtbeckwith
You would need to use withTransaction, since withSession doesn't bind the session to the thread-local and so GORM calls wouldn't use that session.

Burt

> Geoff, ICEpush will adapt to your server : Glassfish, Servlet3 will be
> exploited but this is also Servlet 2.3+ compliant.
>
> Good luck with your trouble. I think you could solve it by manually managing
> your session :
>
> Domainclass.withSession { session->
>
> //work
>
> }
>
> On Wed, Apr 7, 2010 at 8:42 PM, GeoffM <[hidden email]> wrote:
>
> >
> > This sounds interesting - so a grails ICEpush plugin that supports .gsp
> > will
> > be available next week ? Are there any constraints eg Servlet 3.0
> > containers
> > only ....... ?
> >
> > Thanks for your reply ..........Geoff
> > --
> > View this message in context:
> > http://n4.nabble.com/No-thread-bound-request-found-with-Atmosphere-tp1754210p1754787.html
> > Sent from the Grails - user mailing list archive at Nabble.com.
> >
> > ---------------------------------------------------------------------
> > To unsubscribe from this list, please visit:
> >
> >    http://xircles.codehaus.org/manage_email
> >
> >
> >
>
>
>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: "No thread-bound request found" with Atmosphere

smaldini
Ah right, didn't remind the right order, I thought it couldn't open transaction without session bound.

On Thu, Apr 8, 2010 at 7:22 PM, Burt Beckwith <[hidden email]> wrote:
You would need to use withTransaction, since withSession doesn't bind the session to the thread-local and so GORM calls wouldn't use that session.

Burt

> Geoff, ICEpush will adapt to your server : Glassfish, Servlet3 will be
> exploited but this is also Servlet 2.3+ compliant.
>
> Good luck with your trouble. I think you could solve it by manually managing
> your session :
>
> Domainclass.withSession { session->
>
> //work
>
> }
>
> On Wed, Apr 7, 2010 at 8:42 PM, GeoffM <[hidden email]> wrote:
>
> >
> > This sounds interesting - so a grails ICEpush plugin that supports .gsp
> > will
> > be available next week ? Are there any constraints eg Servlet 3.0
> > containers
> > only ....... ?
> >
> > Thanks for your reply ..........Geoff
> > --
> > View this message in context:
> > http://n4.nabble.com/No-thread-bound-request-found-with-Atmosphere-tp1754210p1754787.html
> > Sent from the Grails - user mailing list archive at Nabble.com.
> >
> > ---------------------------------------------------------------------
> > To unsubscribe from this list, please visit:
> >
> >    http://xircles.codehaus.org/manage_email
> >
> >
> >
>
>
>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email





--
Stéphane MALDINI
doc4web consultant
[hidden email]
--
http://fr.linkedin.com/in/smaldini
Loading...