[ 
https://issues.apache.org/jira/browse/CXF-8009?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Attila Király updated CXF-8009:
-------------------------------
    Description: 
When using lambda to implement a jax-rs {{StreamingOutput}} we get a no message 
body writer found error.

However if we use an anonymous class instead of the lambda then it works.

This happens because CXF uses the spring method 
{{ClassUtils.isCglibProxyClass()}} for detecting cglib classes. However that 
method is not strict enough and incorrectly marks every lambda class as cglib 
as well. This causes CXF to get the superclass which will always be 
{{Object.class}} for which there is no message body writer.

According to the [feedback 
received|https://github.com/spring-projects/spring-framework/issues/22706] on 
the spring project instead of {{ClassUtils.isCglibProxyClass()}} (which got 
deprecated) people should use other methods, for example 
{{AopUtils.isCglibProxy()}} which is more strict.

  was:
When using lambda to implement a jax-rs \{{StreamingOutput}} we get a no 
message body writer found error.

However if we use an anonymous class instead of the lambda then it works.

This happens because CXF uses the spring method 
\{{ClassUtils.isCglibProxyClass()}} for detecting cglib classes. However that 
method is not strict enough and incorrectly marks every lambda class as cglib 
as well. This causes CXF to get the superclass which will always be 
\{{Object.class}} for which there is no message body writer.

According to the [feedback 
received|[https://github.com/spring-projects/spring-framework/issues/22706]] on 
the spring project instead of \{{ClassUtils.isCglibProxyClass()}} (which got 
deprecated) people should use other methods, for example 
\{{AopUtils.isCglibProxy()}} which is more strict.


> CXF should not use ClassUtils for cglib checks
> ----------------------------------------------
>
>                 Key: CXF-8009
>                 URL: https://issues.apache.org/jira/browse/CXF-8009
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>    Affects Versions: 2.7.18
>            Reporter: Attila Király
>            Priority: Major
>
> When using lambda to implement a jax-rs {{StreamingOutput}} we get a no 
> message body writer found error.
> However if we use an anonymous class instead of the lambda then it works.
> This happens because CXF uses the spring method 
> {{ClassUtils.isCglibProxyClass()}} for detecting cglib classes. However that 
> method is not strict enough and incorrectly marks every lambda class as cglib 
> as well. This causes CXF to get the superclass which will always be 
> {{Object.class}} for which there is no message body writer.
> According to the [feedback 
> received|https://github.com/spring-projects/spring-framework/issues/22706] on 
> the spring project instead of {{ClassUtils.isCglibProxyClass()}} (which got 
> deprecated) people should use other methods, for example 
> {{AopUtils.isCglibProxy()}} which is more strict.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to