Created https://issues.jboss.org/browse/RESTEASY-677

Thanks!
Sandeep

-----Original Message-----
From: Bill Burke [mailto:bbu...@redhat.com] 
Sent: Monday, March 12, 2012 9:47 AM
To: for...@paaro.com
Cc: resteasy-users@lists.sourceforge.net
Subject: Re: [Resteasy-users] using as7 and resteasy 2.3.1.GA seems that 
sometimes @Context is not injected correctly

You are going to have to deploy your different EJBs within separate WARs.       

On 3/7/12 8:32 AM, for...@paaro.com wrote:
> Our EJBs are in a separate JAR within the EAR. The reason we don't use 
> the scan option is because we have two versions of REST API (and two 
> different web contexts) in our project (one old - for backwards 
> compatibility, and one new). Since all the EJB JARs lie within the 
> same EAR, we had to turn the scanning off, otherwise both WARs would 
> scan REST resources from both versions of our APIs.
>
> Is there a way to turn the scanning on and still have two versions of 
> API within the same EAR?
>
> Thanks!
>
> Peter
>
> On Wed, Mar 7, 2012 at 14:23, Bill Burke <bbu...@redhat.com 
> <mailto:bbu...@redhat.com>> wrote:
>
>     Are your EJBs within the web-inf/classes or web-inf/lib?  If so, don't
>     use resteasy.jndi.resources and let the app server scan for jax-rs
>     services.
>
>     With resteasy.jndi.resources, field injection does not work as Resteasy
>     builds up metadata knowledge by scanning the class of the object
>     returned by a JNDI lookup.
>
>     On 3/7/12 7:36 AM, for...@paaro.com <mailto:for...@paaro.com> wrote:
>      > 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
>     <mailto:ales.bre...@beesmart.tv>
>      > <mailto:ales.bre...@beesmart.tv <mailto:ales.bre...@beesmart.tv>>>
>      >
>      >     Hi,____
>      >
>      >     __ __
>      >
>      >     we have a case here where we use resteasy 2.3.1.GA
>     <http://2.3.1.GA> <http://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
>     <mailto:Resteasy-users@lists.sourceforge.net>
>      > <mailto:Resteasy-users@lists.sourceforge.net
>     <mailto: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
>     <mailto:Resteasy-users@lists.sourceforge.net>
>      > https://lists.sourceforge.net/lists/listinfo/resteasy-users
>
>     --
>     Bill Burke
>     JBoss, a division of Red Hat
>     http://bill.burkecentral.com
>
>
>     
> ------------------------------------------------------------------------------
>     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
>     <mailto:Resteasy-users@lists.sourceforge.net>
>     https://lists.sourceforge.net/lists/listinfo/resteasy-users
>
>

--
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com


------------------------------------------------------------------------------
Try before you buy = See our experts in action!
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-dev2
_______________________________________________
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users
------------------------------------------------------------------------------
Try before you buy = See our experts in action!
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-dev2
_______________________________________________
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users

Reply via email to