cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steve Ardis (JIRA)" <j...@apache.org>
Subject [jira] Commented: (CXF-1494) Issue Using JAX-RS / REST When AOP Proxy In Place
Date Wed, 09 Apr 2008 18:55:29 GMT

    [ https://issues.apache.org/jira/browse/CXF-1494?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12587302#action_12587302
] 

Steve Ardis commented on CXF-1494:
----------------------------------

Sergey - 

I've tried debugging this a little on my side because I'm still not sure how to replicate
this in my dumb-downed project that produced the original error.

But, here's what I can tell you:

In the dumbed-down project that works after your patch, the instance of resourceObject on
line 79 of JAXRSInvoker is an instance called Test$$EnhancerByCGLIB$2484b11, which is basically
a Cglib2AopProxy.

In my more complex project that fails, the instance of resourceObject on line 79 of JAXRSInvoker
is an instance called $Proxy152, which is a JdkDynamicAopProxy.

I'm still trying to figure out how to get my dumbed-down project to fail, but I thought this
information may help in the meantime.  As an FYI, my more complex project is using, at its
core, Spring and Hibernate.  I have several different AOP pointcuts defined that do things
like declarative transaction demarcation, logging, etc...

- Steve


> Issue Using JAX-RS / REST When AOP Proxy In Place
> -------------------------------------------------
>
>                 Key: CXF-1494
>                 URL: https://issues.apache.org/jira/browse/CXF-1494
>             Project: CXF
>          Issue Type: Bug
>          Components: REST
>    Affects Versions: 2.1
>            Reporter: Steve Ardis
>            Assignee: Sergey Beryozkin
>             Fix For: 2.1
>
>         Attachments: cxf-1494.patch
>
>
> 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="test.rest.Test" />
> And you have a Spring AOP pointcut defined as:
> <aop:config>
>     <aop:pointcut id="testOperations" expression="execution(* test.rest.*.*(..))"
/>
>     <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:
> http://incubator.apache.org/cxf/faq.html#FAQ-WhenusingSpringAOPtoenablethingsliketransactionsandsecurity%252CthegeneratedWSDLisverymessedupwithwrongnamespaces%252Cpartnames%252Cetc...
> 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.


Mime
View raw message