I wish we could get a Resteasy contributor who was a heavy user of Spring to sort these types of issues out.
On 2/11/2014 3:14 AM, Jean-François HEROUARD wrote: > Mixing auto-scan may lead to misunderstanding for maintenance of code. I > agree scan should be possible, as long as you do not mix Spring features > with Resteasy, especially bean lifecycle. Usually I inject business > beans in resteasy WS using Spring IoC, @Autowired or @Inject annotations > are ignored if REST URL handlers are not seen by Spring listener. Using > more features of Spring will have some strange side effects if remote > calls are not in a Spring context. After some tests and long time of > debugging trying to understand why Spring is not fully usable (I > remember a case where @Autowired was working but not some EL in @Value), > I only configure Resteasy "Spring MVC integration" in the main app, and > "Spring Integration" in Resteasy for test. For simple REST WS, I have > another war, without any Spring dependency. > > > 2014-02-06 20:41 GMT+01:00 Anthony Whitford <anth...@whitford.com > <mailto:anth...@whitford.com>>: > > I have a project that is using RestEasy -- there were 23 resources. > The project was using "resteasy.scan.resources=true" in the web.xml. > > Now, I added another resource. This time, we need Spring. > So, I add the resteasy-spring dependency and update the web.xml, > according to the docs: > > > http://docs.jboss.org/resteasy/docs/3.0.6.Final/userguide/html/RESTEasy_Spring_Integration.html > > Now, the boot fails because the "scan" can't coexist with Spring. > No problem, I can remove the scan.... But then my original 23 > resources are not available. > > According to the documentation... > >> "RESTEasy will automatically scan for @Provider and JAX-RS >> resource annotations on your bean class and register them as >> JAS-RS resources." > > It would seem that I need to make the 23 resources Spring beans (Add > a @Named annotation, for example), or else manually list them in my > web.xml ("resteasy.resources"), or create an Application instance to > register them... > > Ugh... Why can't the RestEasy-Spring bootstrap automatically > register the resources annotated with @Path? > > Or... Why can't the SCAN coexist with Spring again? > > > > > ------------------------------------------------------------------------------ > Managing the Performance of Cloud-Based Applications > Take advantage of what the Cloud has to offer - Avoid Common Pitfalls. > Read the Whitepaper. > > http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk > _______________________________________________ > Resteasy-users mailing list > Resteasy-users@lists.sourceforge.net > <mailto:Resteasy-users@lists.sourceforge.net> > https://lists.sourceforge.net/lists/listinfo/resteasy-users > > > > > ------------------------------------------------------------------------------ > Android apps run on BlackBerry 10 > Introducing the new BlackBerry 10.2.1 Runtime for Android apps. > Now with support for Jelly Bean, Bluetooth, Mapview and more. > Get your Android app in front of a whole new audience. Start now. > http://pubads.g.doubleclick.net/gampad/clk?id=124407151&iu=/4140/ostg.clktrk > > > > _______________________________________________ > Resteasy-users mailing list > 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 ------------------------------------------------------------------------------ Android apps run on BlackBerry 10 Introducing the new BlackBerry 10.2.1 Runtime for Android apps. Now with support for Jelly Bean, Bluetooth, Mapview and more. Get your Android app in front of a whole new audience. Start now. http://pubads.g.doubleclick.net/gampad/clk?id=124407151&iu=/4140/ostg.clktrk _______________________________________________ Resteasy-users mailing list Resteasy-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/resteasy-users