-
15. Re: No authenticator available for programmatic login
antlia Jul 18, 2013 8:26 AM (in response to albremer)Hi albremer,
thanks for the response, I've two questions for you:
- What do you exactly mean for "cached version of HttpServletRequest"? Do you have this object stored somewhere in you application?
I'm asking this, because my HttpServletRequest comes directly from the REST request, and it's not stored anywhere
- I'm not able to understand how do you prevent HttpServletRequest object from caching its action handlers.
Thanks for your support.
-
16. Re: No authenticator available for programmatic login
albremer Jul 18, 2013 9:20 AM (in response to antlia)Antlia Antlia wrote:
- What do you exactly mean for "cached version of HttpServletRequest"? Do you have this object stored somewhere in you application?
I'm asking this, because my HttpServletRequest comes directly from the REST request, and it's not stored anywhere
- I'm not able to understand how do you prevent HttpServletRequest object from caching its action handlers.
Thanks for your support.
I'm using the dispatch module of gwt-platform https://github.com/ArcBees/GWTP for my RPC stuff, which is a GUICE servlet with an action handler for each RPC request type.
When the servlet receives a request it instanciates the corresponding action handler and lets the handler do all the work. As these handlers are cached, the next rpc request might actually get the same instance of the action handler like the previous one. Due to the caching, I was accidentally using the same HttpServletRequest instance because my constructor was not called, which would have updated the HttpServletRequest member variable.
Maybe you have a similar problem but you are using a different REST implementation, so I'm not sure if this really helps to solve your problem. You might want to check if each of your requests gets a different HttpServletRequest instance. You can also download the JBossWeb (7.0.13) sources, which is what I did, to check exactly where the problem occurs.
Message was edited by: albremer
-
17. Re: No authenticator available for programmatic login
antlia Jul 18, 2013 2:36 PM (in response to albremer)Hi albremer, at leat I got it!
My problem was silghtly different, but you gave me an important indication saying that your HttpServletRequest was cached somehow by the AS.
I noticed that the request made by SOAP services, uses an HttpServletRequest taken programmatically from the WebServiceContext object...the correspondant REST implementation, used an HttpServletRequest injected using @Context annotation inside my bean.
Googling i found this issue on RestEasy:
https://issues.jboss.org/browse/RESTEASY-745
Expecially these two lines:
Instead of injecting HttpServletResponse/Request, get them directly from the context:
HttpServletRequest request = ResteasyProviderFactory.getContextData(HttpServletRequest.class);
HttpServletResponse response = ResteasyProviderFactory.getContextData(HttpServletResponse.class);
I tried this solution, and it works!
Thanks for your idea albremer