2011/10/18 Sergey Beryozkin <[email protected]>: > Hi > > On 18/10/11 08:09, Mateusz Herych wrote: >> >> Hello, >> >> I'm trying to use Continuation API in my CXF based restful webservice. >> Every time I want to access ContinuationProvider - I receive null: >> >> ContinuationProvider provider = >> (ContinuationProvider)context.get(ContinuationProvider.class.getName()); >> Continuation c = provider.getContinuation(); >> >> (second line causes of course NPE). >> I'm using servlet-3.0 api and application is deployed on Tomcat7. >> >> Any ideas what can cause problem? > > That should work, did you get that working ? Hoping yes given that I see > some confirmation on #IRC. However I'm concerned about the continuation > being lost after resume() - please provide more info, > should really work as well > > Sergey > >> >> Thanks, >> Mateusz. > >
Hi, Yes, problem I mentioned in my first post was caused by no async support in web.xml. I added this line: <async-supported>true</async-supported> And everything worked well, almost... Now ContinuationProvider.getContinuation() return null after resuming the request (not always, but in ~95% of cases). Of course - I can store Continuation objects in some HashMap, and then everything seems to be ok at the first glance, but it's not the best solution, i think. No more information in logs, except those about NullPointerException. Thanks, Mateusz.
