cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel Kulp (JIRA)" <>
Subject [jira] Commented: (CXF-1494) Issue Using JAX-RS / REST When AOP Proxy In Place
Date Thu, 03 Apr 2008 21:55:25 GMT


Daniel Kulp commented on CXF-1494:

The JAX-WS case was slightly different.   At the time (and we still kind of do) there was
a requirement that you can use basic JAX-WS services without any of the spring jars available.
  Getting the "real" object out of the proxy requires the spring-aop jar and a couple of it's
dependencies to be available.  Thus, we couldn't really use the spring aop utils thing to
get the class. 

I don't know how people think about being able to use the JAX-RS stuff without spring.   Is
it configurable/usable at all without it?   (Honest question, I don't really know as I haven't

Actually looking at the jaxws stuff a bit more, we MIGHT be able to get it to work by putting
the calls to the spring aop utils stuff into the namespace handler which would only be used
in the spring case.   Basically, if the serviceBean is a proxy and serviceClass is not specified,
in the namespace handler, go ahead and get the service class and set it into the service factory
as if the user had set it.   

That said, doing this will then add the spring-aop jar to the list of required jars (when
using spring) along with cglib-nodeps.   This comes back to the question of whether we should
switch to the full spring jar or keep the individual jars.  If we're going to end up shipping
most of them anyway, might was well grab the full jar.

> Issue Using JAX-RS / REST When AOP Proxy In Place
> -------------------------------------------------
>                 Key: CXF-1494
>                 URL:
>             Project: CXF
>          Issue Type: Bug
>          Components: REST
>    Affects Versions: 2.1
>            Reporter: Steve Ardis
> If your beans.xml contains the following entry:
> <jaxrs:server id="services" address="/">
>     <jaxrs:serviceBeans>
>         <ref bean="test" />
>     </jaxrs:serviceBeans>
> </jaxrs:server>
> <bean id="test" class="" />
> And you have a Spring AOP pointcut defined as:
> <aop:config>
>     <aop:pointcut id="testOperations" expression="execution(**.*(..))"
>     <aop:advisor advice-ref="transactionAdvice" pointcut-ref="testOperations" />
> </aop:config>
> no mapping to the test bean are mapped and method cannot be invoked - it fails with "No
operation found for path: /test/string/"
> If you comment out the contents of <aop:config> everything works fine.
> This link describes the problem with JAX-WS and the same issue probably applies to JAX-RS:
> However, the solution provided in the link does not work due to differences in the APIs
between JAX-WS and JAX-RS.
> I have a dumbed-down Maven project that I can zip up and provide if necessary.
> Is there a suggested way around this problem for JAX-RS?
> Is there a reason that, if the instance of the class that JAX-RS sees is a proxy object,
that it can't get the underlying class information by drilling into the proxy object, thereby
eliminating the necessity to define the serviceClass information (as in the JAX-WS "fix")?
 Ideally , I'd like to be able to do the following:
> <jaxrs:server id="services" address="/">
>     <jaxrs:serviceBeans>
>         <ref bean="test1" />
>         <ref bean="test2" />
>         <ref bean="test3" />
>     </jaxrs:serviceBeans>
> </jaxrs:server>
> without having to define separate jaxrs server(s) (as in the JAX-WS "fix").

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message