From: Neil C. <nch...@po...> - 2009-10-03 08:18:54
|
As it turned out, I got the PreProcessInterceptor working, and the resolution was about as quirky as Leandro's. For me, I need to have my interceptor defined BOTH in XML configuration AND annotated with @Component. Apparently, to do one or the other alone causes the interceptor not to fire. The question going forward then is if this is a bug or a feature. Thanks. -----Original Message----- From: Neil Chaudhuri Sent: Fri 10/2/2009 5:56 PM To: Leandro Ferro Luzia Cc: Res...@li... Subject: RE: [Resteasy-developers] PreProcessInterceptor Not Intercepting It's interesting that worked for you. I would think that your solution would be a factor in getting Spring to find your interceptor rather than RESTEasy. Then again, I know anything is possible in a given deployment scenario. Unfortunately, your solution didn't work for me. As I mentioned before, Spring is finding my class (whether with @Component or with bean configuration in XML as you suggested), but RESTEasy clearly is not according to both the logs and the behavior of the application. Thanks anyway, Leandro, for your suggestion. Any other insight is appreciated. -----Original Message----- From: Leandro Ferro Luzia [mailto:lea...@gm...] Sent: Fri 10/2/2009 5:32 PM To: Neil Chaudhuri Cc: Res...@li... Subject: Re: [Resteasy-developers] PreProcessInterceptor Not Intercepting I had a similar problem, and to solve it, I declared the interceptor as the first bean in the spring configuration. I hope that helps you. Cheers 2009/10/2 Neil Chaudhuri <nch...@po...> > I am using Spring and RESTEasy, and I am trying to apply a > PreProcessInterceptor that doesn't seem to be firing. According to the logs, > Spring loads it, but it never seems to fire. Here is the declaration: > > @Component > @Provider > @ServerInterceptor > public class QueryNotificationInterceptor implements PreProcessInterceptor > { > public ServerResponse preProcess(HttpRequest request, ResourceMethod > resourceMethod) throws Failure, WebApplicationException {...} > } > > An interesting thing to note is that if I remove the @ServerInterceptor > just for kicks, I don't get any deployment errors either, which runs counter > to the documentation at Section 29.1. > > Please let me know if I need to provide further information. I appreciate > any insight. > > Thanks. > > > ------------------------------------------------------------------------------ > Come build with us! The BlackBerry® Developer Conference in SF, CA > is the only developer event you need to attend this year. Jumpstart your > developing skills, take BlackBerry mobile applications to market and stay > ahead of the curve. Join us from November 9-12, 2009. Register now! > http://p.sf.net/sfu/devconf > _______________________________________________ > Resteasy-developers mailing list > Res...@li... > https://lists.sourceforge.net/lists/listinfo/resteasy-developers > > -- -------------------------------------------------------------- Leandro Ferro Luzia "Computer science is no more about computers than astronomy is about telescopes." - Dijkstra "There's nothing remarkable about it. All one has to do is hit the right keys at the right time and the instrument plays itself" - Bach ---------------------------------------------------------------- |