It seems that the problem might be in the way we inject @Context data. If
class-level injected, the problem appears (as Aleš pointed out), but when
injected on the method level (via method parameter), everything seems to be
ok.

Peter

2012/3/6 Aleš Bregar <ales.bre...@beesmart.tv>

>  Hi,****
>
> ** **
>
> we have a case here where we use resteasy 2.3.1.GA in the following way:**
> **
>
> **-          **Rest endpoints are SLSB EJBs with interface marked with
> @Path annotations****
>
> **-          **Those beans are registered to resteasy via web.xml****
>
> ** **
>
> <context-param>****
>
>                 <param-name>resteasy.jndi.resources</param-name>****
>
>                 <param-value>****
>
>                                global/msdp/api-ejb/BaseBean,****
>
>                                global/msdp/api-ejb/AccessBean,****
>
>                                ...  (and some more)****
>
>                 </param-value>****
>
> </context-param>****
>
> ** **
>
> **-          **we have created some custom ouath mechanism and filter
> which validate the message and add attributes to the request****
>
> **-          **and when it comes to Bean eq.:****
>
> ** **
>
> @Stateless****
>
> public class BaseBean implements Base {****
>
>                 ****
>
>                 @EJB****
>
>                 protected UtilService us;****
>
> ** **
>
>                 @Context****
>
>                 protected HttpServletRequest request;****
>
> ** **
>
>                 @Context****
>
>                 protected HttpServletResponse response;****
>
> ** **
>
>                 @Context****
>
>                 protected UriInfo uriInfo;****
>
> ** **
>
>                 @Inject****
>
>                 private UserLinkRepository userLinkRepository;****
>
>                 ****
>
>                 ...****
>
> ** **
>
> Seems that everything is injected correctly and all seemed to work quite
> fine.****
>
> ** **
>
> ** **
>
> But with some testing I see some strange behaviour which IMO is most
> probably around @Context injection. Sometimes it happen that
> HttpServletRequest  object in the filter is not the same as one injected to
> bean (debugged by object hash code) and/or also attributes set to the
> request in the filter  are not proper when read in the bean or even not
> set(are null?). Sometimes when this race condition happens it helps if I
> wait some random time (for container to cleanup something? I gess) and next
> request is successful again.****
>
> ** **
>
> ** **
>
> I would ask for some hint or maybe a point where to start looking at.****
>
> ** **
>
> Thank you in advance and brg,****
>
> Aleš****
>
> ** **
>
>
> ------------------------------------------------------------------------------
> Keep Your Developer Skills Current with LearnDevNow!
> The most comprehensive online learning library for Microsoft developers
> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
> Metro Style Apps, more. Free future releases when you subscribe now!
> http://p.sf.net/sfu/learndevnow-d2d
> _______________________________________________
> Resteasy-users mailing list
> Resteasy-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/resteasy-users
>
>
------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users

Reply via email to