You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Steve Ardis (JIRA)" <ji...@apache.org> on 2008/03/28 20:20:24 UTC

[jira] Created: (CXF-1494) Issue Using JAX-RS / REST When AOP Proxy In Place

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


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.


[jira] Commented: (CXF-1494) Issue Using JAX-RS / REST When AOP Proxy In Place

Posted by "Sergey Beryozkin (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-1494?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12588117#action_12588117 ] 

Sergey Beryozkin commented on CXF-1494:
---------------------------------------

According to http://static.springframework.org/spring/docs/2.5.x/reference/aop.html#aop-proxying

JDK Proxy will be used if the bean implements at least one interface, that section also shows how to enforce the use of CGLIB 
proxies, using proxy-target-class="true" attribute

The new patch will support a case where a JDK Proxy is created, but for the method like the one in the attached Test class be invoked
through JAX-RS, this method has to come as part of implementing the interface,  as one can't get non-interface methods from a JDK Proxy 

That is you'll need to do :

Test implements TestInterface {
   public void doIt() {
   }
}

if that is not suitable for some reasons that you'd need to force a CGLIB proxy be created as described in the spring aop docs...
 

> 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: beans.xml, cxf-1494.patch, Test.java
>
>
> 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.


[jira] Reopened: (CXF-1494) Issue Using JAX-RS / REST When AOP Proxy In Place

Posted by "Sergey Beryozkin (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-1494?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sergey Beryozkin reopened CXF-1494:
-----------------------------------


> 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.


[jira] Commented: (CXF-1494) Issue Using JAX-RS / REST When AOP Proxy In Place

Posted by "Steve Ardis (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-1494?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12589124#action_12589124 ] 

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

Works perfectly - thanks for responding so quickly on fixing this.

For others who may find this thread later, looking for some help, I want to stress one of your comments above:  "The new patch will support a case where a JDK Proxy is created, but for the method like the one in the attached Test class be invoked through JAX-RS, this method has to come as part of implementing the interface, as one can't get non-interface methods from a JDK Proxy."

This caused me a little grief this morning, as I couldn't figure out why it still wasn't working, but trusted you guys knew what you were doing.  So, I kept re-reading your comments and trying various things.

To re-summarize for others, it is not enough to annotate your implementation class with the "javax.ws.rs.*" annotations if you are using Spring and the JdkDynamicAopProxy.  Because the non-interface methods are not visible from the JdkDynamicAopProxy, you'll have to also add the method to the interface your bean implements.  Its obvious once you understand why, but can be easily overlooked when implementing - especially because the method I exposed on the service implementation was just a REST helper that wrapped a call to another method on the service with a more complex parameter.

Thanks again -


> 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: beans.xml, cxf-1494-2.patch, cxf-1494.patch, Test.java
>
>
> 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.


[jira] Updated: (CXF-1494) Issue Using JAX-RS / REST When AOP Proxy In Place

Posted by "Sergey Beryozkin (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-1494?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sergey Beryozkin updated CXF-1494:
----------------------------------

    Attachment: cxf-1494.patch

> 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
>         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.


[jira] Commented: (CXF-1494) Issue Using JAX-RS / REST When AOP Proxy In Place

Posted by "Steve Ardis (JIRA)" <ji...@apache.org>.
    [ 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.


[jira] Commented: (CXF-1494) Issue Using JAX-RS / REST When AOP Proxy In Place

Posted by "Sergey Beryozkin (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-1494?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12583667#action_12583667 ] 

Sergey Beryozkin commented on CXF-1494:
---------------------------------------

> 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

It makes sense but I reckon there's a (slim) possibility of the resource class itself being a proxy ? 

Perhaps we can do 

<jaxrs:server id="services" address="/" proxyAware="true"> 
    <jaxrs:serviceBeans> 
        <ref bean="test1" /> 
        <ref bean="test2" /> 
        <ref bean="test3" /> 
    </jaxrs:serviceBeans> 
</jaxrs:server>

thus giving an explicit indication to JAX-RS runtime that it's ok to attempt to introspect Proxy instances further ?


> 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
>
> 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.


[jira] Issue Comment Edited: (CXF-1494) Issue Using JAX-RS / REST When AOP Proxy In Place

Posted by "Steve Ardis (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-1494?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12584561#action_12584561 ] 

yarddog edited comment on CXF-1494 at 4/2/08 6:17 AM:
----------------------------------------------------------

Seeing that 'proxyAware' is more of a hint than a forced requirement on the bean classes, your suggestion to put it on <jaxrs:server> should be sufficient.  I do like the idea of the proxyAware default being true, as I think (with Hibernate/Spring/CGLIB) the scenario where the bean class is a proxy to another object will be more often the case than the resource class itself being a proxy.  Right off the bat, I can't think of a scenario where I'd want the resource class to be a proxy - but, there probably is some case I'm just not thinking of.

Any concern about how this differs from the jaxws stuff?  I have some concerns about how the jaxws piece appears to be implemented for this scenario (mainly in that it appears I would have to create a different <jaxws:server> for each serviceClass/serviceBean), but that's a different forum.  But, obviously, similar implementations would be ideal.

The jaxws implementation I'm referring to is:
http://incubator.apache.org/cxf/faq.html#FAQ-WhenusingSpringAOPtoenablethingsliketransactionsandsecurity%252CthegeneratedWSDLisverymessedupwithwrongnamespaces%252Cpartnames%252Cetc


      was (Author: yarddog):
    Seeing that 'proxyAware' is more of a hint than a forced requirement on the bean classes, your suggestion to put it on <jaxrs:server> should be sufficient.  I do like the idea of the proxyAware default being true, as I think (with Hibernate/Spring/CGLIB) the scenario where the bean class is a proxy to another object will be more often the case than the resource class itself being a proxy.  Right off the bat, I can't think of a scenario where I'd want the resource class to be a proxy - but, there probably is some case I'm just not thinking of.

Any concern about how this differs from the jaxws stuff?  I have some concerns about how the jaxws piece appears to be implemented for this scenario (mainly in that it appears I would have to create a different <jaxws:server> for each serviceClass/serviceBean), but that's a different forum.  But, obviously, similar implementations would be ideal.
  
> 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
>
> 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.


[jira] Commented: (CXF-1494) Issue Using JAX-RS / REST When AOP Proxy In Place

Posted by "Steve Ardis (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-1494?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12587332#action_12587332 ] 

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

OK - I finally have it narrowed down to some specifics.

I believe the two attached source files are all you need to replicate this issue.  Obviously, you'd have to configure your datasource appropriately for your environment.  My initial guess is that its going to have something to do with the HibernateTransactionManager pointcut I have defined and that it uses the JdkDynamicAopProxy (as opposed to a cglib proxy instance).  But, I far from an expert in how all of these libraries play together.

> 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.


[jira] Commented: (CXF-1494) Issue Using JAX-RS / REST When AOP Proxy In Place

Posted by "Daniel Kulp (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-1494?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12585729#action_12585729 ] 

Daniel Kulp commented on CXF-1494:
----------------------------------


I've added a utility to common that will autodetect if spring-aop jar is available and, if so, do the right thing to get the class.   If not, it just calls the normal obj.getClass() thing it currently does.

Thus, all you SHOULD need to do to support this case is to find all the calls to obj.getClass() and replace it with:
ClassHelper.getRealClass(obj)
and it will probably all work without having to take any direct dependency on spring or spring-aop.



> 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
>
> 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.


[jira] Updated: (CXF-1494) Issue Using JAX-RS / REST When AOP Proxy In Place

Posted by "Sergey Beryozkin (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-1494?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sergey Beryozkin updated CXF-1494:
----------------------------------

    Attachment: cxf-1494-2.patch

* support for complex AOP scenarous
* conversion of annotated parameters into classes with either constructors or static  valueOf methods accepting String
* inheritance of most annotations from superclasses/interfaces

> 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: beans.xml, cxf-1494-2.patch, cxf-1494.patch, Test.java
>
>
> 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.


[jira] Commented: (CXF-1494) Issue Using JAX-RS / REST When AOP Proxy In Place

Posted by "Sergey Beryozkin (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-1494?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12585952#action_12585952 ] 

Sergey Beryozkin commented on CXF-1494:
---------------------------------------

I forgot a cable plug for my laptop at work, so I have 10 mins in the battery, trying to setup a system test. So I'll have to fix it early next week...

> 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
>
> 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.


[jira] Issue Comment Edited: (CXF-1494) Issue Using JAX-RS / REST When AOP Proxy In Place

Posted by "Steve Ardis (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-1494?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12584561#action_12584561 ] 

yarddog edited comment on CXF-1494 at 4/2/08 6:16 AM:
----------------------------------------------------------

Seeing that 'proxyAware' is more of a hint than a forced requirement on the bean classes, your suggestion to put it on <jaxrs:server> should be sufficient.  I do like the idea of the proxyAware default being true, as I think (with Hibernate/Spring/CGLIB) the scenario where the bean class is a proxy to another object will be more often the case than the resource class itself being a proxy.  Right off the bat, I can't think of a scenario where I'd want the resource class to be a proxy - but, there probably is some case I'm just not thinking of.

Any concern about how this differs from the jaxws stuff?  I have some concerns about how the jaxws piece appears to be implemented for this scenario (mainly in that it appears I would have to create a different <jaxws:server> for each serviceClass/serviceBean), but that's a different forum.  But, obviously, similar implementations would be ideal.

      was (Author: yarddog):
    Seeing that 'proxyAware' is more of a hint than a forced requirement on the bean classes, your suggestion to put it on <jaxrs:server> should be sufficient.  I do like the idea of the proxyAware default being true, as I think (with Hibernate/Spring/CGLIB) the scenario where the bean class is a proxy to another object will be more often the case than the resource class itself being a proxy.  Right off the bat, I can't think of a scenario where I'd want the resource class to be a proxy - but, there probably is some case I'm just not thinking of.

Any concern about how this differs from the jaxws stuff?  I have some concerns about how the jaxws piece appears to be implemented for this scenario (mainly in that it appears I would have to create a different <jaxws:server> for each serviceClass/serviceBean, but that's a different forum.  But, obviously, similar implementations would be ideal.
  
> 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
>
> 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.


[jira] Issue Comment Edited: (CXF-1494) Issue Using JAX-RS / REST When AOP Proxy In Place

Posted by "Steve Ardis (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-1494?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12587332#action_12587332 ] 

yarddog edited comment on CXF-1494 at 4/9/08 1:32 PM:
----------------------------------------------------------

OK - I finally have it narrowed down to some specifics.

I believe the two attached source files (beans.xml and Test.java) are all you need to replicate this issue.  Obviously, you'd have to configure your datasource appropriately for your environment.  My initial guess is that its going to have something to do with the HibernateTransactionManager pointcut I have defined and that it uses the JdkDynamicAopProxy (as opposed to a cglib proxy instance).  But, I far from an expert in how all of these libraries play together.

      was (Author: yarddog):
    OK - I finally have it narrowed down to some specifics.

I believe the two attached source files are all you need to replicate this issue.  Obviously, you'd have to configure your datasource appropriately for your environment.  My initial guess is that its going to have something to do with the HibernateTransactionManager pointcut I have defined and that it uses the JdkDynamicAopProxy (as opposed to a cglib proxy instance).  But, I far from an expert in how all of these libraries play together.
  
> 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.


[jira] Commented: (CXF-1494) Issue Using JAX-RS / REST When AOP Proxy In Place

Posted by "Steve Ardis (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-1494?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12584234#action_12584234 ] 

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

Not a bad idea - but, I'd be concerned that the proxyAware setting may not apply to all of the <ref bean="..."> entries in the list.  Would proxyAware="true" just mean that a check should occur on each bean in the list, or that each bean would need to be a proxy?  The setting may be more appropriate on an a serviceBean entry - i.e.

<jaxrs:server id="services" address="/" proxyAware="true">
    <jaxrs:serviceBeans>

        <jaxrs:serviceBean proxyAware="true">
            <bean="test1" />
        </jaxrs:serviceBean>

        <jaxrs:serviceBean proxyAware="false">
            <bean="test2" />
        </jaxrs:serviceBean>

        <jaxrs:serviceBean>   <!-- means proxyAware="false"   -->
            <bean="test3" />
        </jaxrs:serviceBean>

        <bean="test4" />    <!-- equivalent to the test3 example, where proxyAware is defaulted to "false"   -->

    </jaxrs:serviceBeans>
</jaxrs:server> 

I'm looking a little more at the schema and CXF (in general) to understand exactly what I'm suggesting.  But, I'm having issues checking out the code.  Eclipse is currently giving me a "cannot checkout" error from subversion.

checkout -r HEAD http://svn.apache.org/repos/asf/incubator/cxf/trunk/rt/core
    RA layer request failed
svn: REPORT request failed on '/repos/asf/!svn/vcc/default'
svn: REPORT of '/repos/asf/!svn/vcc/default': 400 Bad Request (http://svn.apache.org)


> 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
>
> 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.


[jira] Commented: (CXF-1494) Issue Using JAX-RS / REST When AOP Proxy In Place

Posted by "Sergey Beryozkin (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-1494?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12585640#action_12585640 ] 

Sergey Beryozkin commented on CXF-1494:
---------------------------------------

> I don't know how people think about being able to use the JAX-RS stuff without spring. 

JAX-RS is usable without Spring. I think Jervis added the Spring support at a later stage...

> Getting the "real" object out of the proxy requires the spring-aop jar and a couple of it's dependencies to be available

Hmm. It's getting a bit hairy :-) I thought it would be simpler...The idea of doing this unwrapping in a Spring handler only is interesting, but it's likely that Proxies may be created by not only Spring AOP ? 

Is there some generic solution to extracting the underlying class this Proxy wraps ?

So perhaps the jaxws 'fix' is indeed the best fix ? No extra dependencies needed. This class would need to be created for every serviceBean but may be it's not that big a deal ?

> 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
>
> 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.


[jira] Commented: (CXF-1494) Issue Using JAX-RS / REST When AOP Proxy In Place

Posted by "Sergey Beryozkin (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-1494?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12588650#action_12588650 ] 

Sergey Beryozkin commented on CXF-1494:
---------------------------------------

Steve, can you please confirm a fix ? Dan has just applied a patch, you may want to build from jax-rs component from a trunk or wait for a snapshot be ready...

> 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: beans.xml, cxf-1494-2.patch, cxf-1494.patch, Test.java
>
>
> 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.


[jira] Commented: (CXF-1494) Issue Using JAX-RS / REST When AOP Proxy In Place

Posted by "Steve Ardis (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-1494?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12586957#action_12586957 ] 

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

Thanks for patching this so quickly.

After downloading the latest snapshot, my simple dumbed-down test project worked beautifully.  However, my "real" project is throwing the following exception:

2008-04-08 16:28:41.621::INFO:  Started SelectChannelConnector@0.0.0.0:8080
Apr 8, 2008 4:28:45 PM org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor handleMessage
INFO: Found operation: getTestString
Apr 8, 2008 4:28:45 PM org.apache.cxf.phase.PhaseInterceptorChain doIntercept
INFO: Application has thrown exception, unwinding now
org.apache.cxf.interceptor.Fault: object is not an instance of declaring class while invoking public java.lang.String a.b.c.ServiceImpl.getTestString() with params [].
	at org.apache.cxf.service.invoker.AbstractInvoker.createFault(AbstractInvoker.java:109)
	at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:101)
	at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:79)
	at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:52)
	at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:56)
	at org.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExecutor.java:37)
	at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:92)
	at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:220)
	at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:78)
	at org.apache.cxf.transport.servlet.ServletDestination.invoke(ServletDestination.java:92)
	at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:214)
	at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:113)
	at org.apache.cxf.transport.servlet.AbstractCXFServlet.invoke(AbstractCXFServlet.java:170)
	at org.apache.cxf.transport.servlet.AbstractCXFServlet.doGet(AbstractCXFServlet.java:152)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
	at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
	at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:362)
	at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
	at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
	at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:726)
	at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
	at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:206)
	at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
	at org.mortbay.jetty.Server.handle(Server.java:324)
	at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505)
	at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:828)
	at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:514)
	at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
	at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380)
	at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:395)
	at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:450)
Caused by: java.lang.IllegalArgumentException: object is not an instance of declaring class
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:585)
	at org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:124)
	at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:82)
	... 31 more


I can post more of the specifics on the configuration of the bean "a.b.c.ServiceImpl" (I have changed it from the real name), but I was hoping you might be able to eyeball the exception and provide a diagnosis based on your understanding of the patch you just applied.  So, it appears the mapping is now being found (based on your patch), but for some reason it can't invoke the method due to the reference not being what it thought it would be.

Any help is greatly appreciated.

> 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.


[jira] Resolved: (CXF-1494) Issue Using JAX-RS / REST When AOP Proxy In Place

Posted by "Daniel Kulp (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-1494?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Daniel Kulp resolved CXF-1494.
------------------------------

    Resolution: Fixed

> 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: beans.xml, cxf-1494-2.patch, cxf-1494.patch, Test.java
>
>
> 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.


[jira] Commented: (CXF-1494) Issue Using JAX-RS / REST When AOP Proxy In Place

Posted by "Daniel Kulp (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-1494?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12588727#action_12588727 ] 

Daniel Kulp commented on CXF-1494:
----------------------------------

 
No, it wouldn't.  I just committed the code this morning.

I'll be doing another snapshot build sometime later today which will have it.


> 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: beans.xml, cxf-1494-2.patch, cxf-1494.patch, Test.java
>
>
> 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.


[jira] Commented: (CXF-1494) Issue Using JAX-RS / REST When AOP Proxy In Place

Posted by "Sergey Beryozkin (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-1494?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12584467#action_12584467 ] 

Sergey Beryozkin commented on CXF-1494:
---------------------------------------

That said, perhaps we shoudl also support the proxyAware overriding on individual beans, as you suggested, in those rare cases when the resource class itself is a proxy, but I'd still prefer to start with an attribute on the jaxrs:server, as supporting attributes on jaxrs:serviceBean is just likely to be a bit more complicated... 

I'm nearly ready to go with your original suggestion and basically make proxyAware="true" be a default value and if we ever have a case for resources class being a proxy then we can introduce the actual proxyAware attribute...That said, perhaps having an explict proxyAware attribute from a start makes it a bit more descriptive

> 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
>
> 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.


[jira] Commented: (CXF-1494) Issue Using JAX-RS / REST When AOP Proxy In Place

Posted by "Sergey Beryozkin (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-1494?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12586146#action_12586146 ] 

Sergey Beryozkin commented on CXF-1494:
---------------------------------------

Drew to work to pick it up...

Dan, I had to update slightly ClassHelper, have a look at the attached patch...



> 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
>         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.


[jira] Commented: (CXF-1494) Issue Using JAX-RS / REST When AOP Proxy In Place

Posted by "Sergey Beryozkin (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-1494?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12587721#action_12587721 ] 

Sergey Beryozkin commented on CXF-1494:
---------------------------------------

Does anyone know how to create an instance of JdkDynamicAopProxy manually in the code ?

> 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: beans.xml, cxf-1494.patch, Test.java
>
>
> 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.


[jira] Commented: (CXF-1494) Issue Using JAX-RS / REST When AOP Proxy In Place

Posted by "Steve Ardis (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-1494?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12587740#action_12587740 ] 

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

This might help:
http://jsourcery.com/output/sourceforge/spring/1.2rc1/org/springframework/aop/framework/JdkDynamicProxyTests.source.html

Take a look at the test method testInterceptorIsInvokedWithNoTarget()

- 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: beans.xml, cxf-1494.patch, Test.java
>
>
> 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.


[jira] Commented: (CXF-1494) Issue Using JAX-RS / REST When AOP Proxy In Place

Posted by "Sergey Beryozkin (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-1494?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12587097#action_12587097 ] 

Sergey Beryozkin commented on CXF-1494:
---------------------------------------

Can you please provide a bit more info. I'd need to update a system test to fail first so that a proper fix can be found.

Lets assume we have a.b.c.ServiceImpl with a single "String getTestString()" method.
This ServiceImpl is a root class with a @Path annotation and it's been injected into a JAX-RS server runtime through the spring config. Can you please show the spring configuration (simplified if you prefer but reflecting the real scenario as much as possible), including the aop one for this ServiceImpl ? 



> 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.


[jira] Commented: (CXF-1494) Issue Using JAX-RS / REST When AOP Proxy In Place

Posted by "Daniel Kulp (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-1494?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12585300#action_12585300 ] 

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 looked.)


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: https://issues.apache.org/jira/browse/CXF-1494
>             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="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.


[jira] Commented: (CXF-1494) Issue Using JAX-RS / REST When AOP Proxy In Place

Posted by "Sergey Beryozkin (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-1494?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12589125#action_12589125 ] 

Sergey Beryozkin commented on CXF-1494:
---------------------------------------

Excellent news, thanks for a quick confirmation. I'll update the docs (one of those promises :-)).
Using proxy-target-class="true" on a bean may let you avoid introducing a new interface (CGLIB subclassing will be used), but I haven't tried

> 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: beans.xml, cxf-1494-2.patch, cxf-1494.patch, Test.java
>
>
> 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.


[jira] Commented: (CXF-1494) Issue Using JAX-RS / REST When AOP Proxy In Place

Posted by "Sergey Beryozkin (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-1494?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12584461#action_12584461 ] 

Sergey Beryozkin commented on CXF-1494:
---------------------------------------

> Not a bad idea - but, I'd be concerned that the proxyAware setting may not apply to all of the <ref bean="..."> entries 

I reckon this should not be an issue. 'proxyAware' is just an explicit hint to the the runtime that if one of the resource classes (or all of them) happens to be a Proxy (for whatever reasons, due to Spring 'interference' or to something else) then the runtime should try to get to the class this Proxy wraps...

<jaxrs:serviceBean proxyAware="true"> would also work but having ths attribute on a jaxrs: server should make it simpler to deal with...Would you agree ?

> 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
>
> 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.


[jira] Commented: (CXF-1494) Issue Using JAX-RS / REST When AOP Proxy In Place

Posted by "Sergey Beryozkin (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-1494?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12588121#action_12588121 ] 

Sergey Beryozkin commented on CXF-1494:
---------------------------------------

cxf-1494-2.patch is the latest update 

> 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: beans.xml, cxf-1494-2.patch, cxf-1494.patch, Test.java
>
>
> 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.


[jira] Commented: (CXF-1494) Issue Using JAX-RS / REST When AOP Proxy In Place

Posted by "Steve Ardis (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-1494?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12584561#action_12584561 ] 

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

Seeing that 'proxyAware' is more of a hint than a forced requirement on the bean classes, your suggestion to put it on <jaxrs:server> should be sufficient.  I do like the idea of the proxyAware default being true, as I think (with Hibernate/Spring/CGLIB) the scenario where the bean class is a proxy to another object will be more often the case than the resource class itself being a proxy.  Right off the bat, I can't think of a scenario where I'd want the resource class to be a proxy - but, there probably is some case I'm just not thinking of.

Any concern about how this differs from the jaxws stuff?  I have some concerns about how the jaxws piece appears to be implemented for this scenario (mainly in that it appears I would have to create a different <jaxws:server> for each serviceClass/serviceBean, but that's a different forum.  But, obviously, similar implementations would be ideal.

> 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
>
> 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.


[jira] Commented: (CXF-1494) Issue Using JAX-RS / REST When AOP Proxy In Place

Posted by "Daniel Kulp (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-1494?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12587635#action_12587635 ] 

Daniel Kulp commented on CXF-1494:
----------------------------------


Sergey/Steve,

I haven't looked at the code, but I'm pretty sure I know what the problem is....

In the proxy case, the Method object that is used to determine the annotations cannot be the method object that is used to do the invoke.   It's kind of a strang case, but the proxy isn't actually an instance of the class.  (it works in the cglib case, as it's a generated subclass that overrides the method).  Most likely what needs to be done it use the Class cls = ClassHelper.getRealClass(...) to get the class for the lookup of the methods for the annotations, but then if cls.isInstance(obj) returns false, you'll need to call obj.getClass() and find the corresponding method on that to really do the invoke.

Dan

> 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: beans.xml, cxf-1494.patch, Test.java
>
>
> 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.


[jira] Commented: (CXF-1494) Issue Using JAX-RS / REST When AOP Proxy In Place

Posted by "Sergey Beryozkin (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-1494?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12587669#action_12587669 ] 

Sergey Beryozkin commented on CXF-1494:
---------------------------------------

JAXRSInvoker has this code :

Object serviceObject = null;

Class c  = cri.getResourceClass();
            for (Object resourceObject : resources) {
                if (c.isInstance(resourceObject)) {
                    serviceObject = resourceObject;
                }
            } 

Multiple service beans can be available so here it checks for the match...Putting aside this fact (lets assume we have a single service bean instance), do you mean 
that if this 

if (c.isInstance(resourceObject)) fails 

then a Method needs to be found on the resourceObject.getClass(), which will then be invoked ?



> 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: beans.xml, cxf-1494.patch, Test.java
>
>
> 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.


[jira] Resolved: (CXF-1494) Issue Using JAX-RS / REST When AOP Proxy In Place

Posted by "Daniel Kulp (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-1494?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Daniel Kulp resolved CXF-1494.
------------------------------

       Resolution: Fixed
    Fix Version/s: 2.1
         Assignee: Sergey Beryozkin

> 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.


[jira] Updated: (CXF-1494) Issue Using JAX-RS / REST When AOP Proxy In Place

Posted by "Steve Ardis (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-1494?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Steve Ardis updated CXF-1494:
-----------------------------

    Attachment: Test.java
                beans.xml

Files to replicate issue "org.apache.cxf.interceptor.Fault: object is not an instance of declaring class while invoking......"

> 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: beans.xml, cxf-1494.patch, Test.java
>
>
> 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.


[jira] Issue Comment Edited: (CXF-1494) Issue Using JAX-RS / REST When AOP Proxy In Place

Posted by "Steve Ardis (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-1494?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12587334#action_12587334 ] 

yarddog edited comment on CXF-1494 at 4/9/08 1:36 PM:
----------------------------------------------------------

Files to replicate issue "org.apache.cxf.interceptor.Fault: object is not an instance of declaring class while invoking......" have been attached.

      was (Author: yarddog):
    Files to replicate issue "org.apache.cxf.interceptor.Fault: object is not an instance of declaring class while invoking......"
  
> 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: beans.xml, cxf-1494.patch, Test.java
>
>
> 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.


[jira] Commented: (CXF-1494) Issue Using JAX-RS / REST When AOP Proxy In Place

Posted by "Steve Ardis (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-1494?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12588670#action_12588670 ] 

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

Sergey / Dan - 

Can you confirm whether or not the fix / patch would have been included in the "cxf-rt-frontend-jaxrs-2.1-incubator-20080411.173632-38.jar" SNAPSHOT release?  If it is included, my initial test failed, but I could still be running with a older version.  Hoping you'll say that it was not.

I am unable to build this myself, as I am receive the following errors from within Eclipse when trying to update the code:

RA layer request failed
svn: REPORT request failed on 'http://svn.apache.org/repos/asf/incubator/cxf/trunk/rt/frontend/jaxrs'
svn: REPORT of 'http://svn.apache.org/repos/asf/incubator/cxf/trunk/rt/frontend/jaxrs': 400 Bad Request (http://svn.apache.org)

I am looking into what this Subversion/Eclipse error means.

> 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: beans.xml, cxf-1494-2.patch, cxf-1494.patch, Test.java
>
>
> 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.