|
View:
New views
20 Messages
—
Rating Filter:
Alert me
|
| < Prev | 1 - 2 | Next > |
|
|
Created: (CXF-1494) Issue Using JAX-RS / REST When AOP Proxy In PlaceIssue 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. |
|
|
Commented: (CXF-1494) Issue Using JAX-RS / REST When AOP Proxy In Place[ 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. |
|
|
Commented: (CXF-1494) Issue Using JAX-RS / REST When AOP Proxy In Place[ 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. |
|
|
Commented: (CXF-1494) Issue Using JAX-RS / REST When AOP Proxy In Place[ 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. |
|
|
Commented: (CXF-1494) Issue Using JAX-RS / REST When AOP Proxy In Place[ 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. |
|
|
Commented: (CXF-1494) Issue Using JAX-RS / REST When AOP Proxy In Place[ 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. |
|
|
Issue Comment Edited: (CXF-1494) Issue Using JAX-RS / REST When AOP Proxy In Place[ 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. |
|
|
Issue Comment Edited: (CXF-1494) Issue Using JAX-RS / REST When AOP Proxy In Place[ 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. |
|
|
Commented: (CXF-1494) Issue Using JAX-RS / REST When AOP Proxy In Place[ 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. |
|
|
Commented: (CXF-1494) Issue Using JAX-RS / REST When AOP Proxy In Place[ 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. |
|
|
Commented: (CXF-1494) Issue Using JAX-RS / REST When AOP Proxy In Place[ 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. |
|
|
Commented: (CXF-1494) Issue Using JAX-RS / REST When AOP Proxy In Place[ 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. |
|
|
Updated: (CXF-1494) Issue Using JAX-RS / REST When AOP Proxy In Place[ 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. |
|
|
Commented: (CXF-1494) Issue Using JAX-RS / REST When AOP Proxy In Place[ 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. |
|
|
Resolved: (CXF-1494) Issue Using JAX-RS / REST When AOP Proxy In Place[ 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. |
|
|
Commented: (CXF-1494) Issue Using JAX-RS / REST When AOP Proxy In Place[ 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@...: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. |
|
|
Reopened: (CXF-1494) Issue Using JAX-RS / REST When AOP Proxy In Place[ 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. |
|
|
Commented: (CXF-1494) Issue Using JAX-RS / REST When AOP Proxy In Place[ 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. |
|
|
Commented: (CXF-1494) Issue Using JAX-RS / REST When AOP Proxy In Place[ 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. |
|
|
Commented: (CXF-1494) Issue Using JAX-RS / REST When AOP Proxy In Place[ 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. |
| < Prev | 1 - 2 | Next > |
| Free embeddable forum powered by Nabble | Forum Help |