You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Eric Milles (Jira)" <ji...@apache.org> on 2021/03/30 17:00:00 UTC

[jira] [Commented] (GROOVY-5410) Groovy Generics Not Playing nice with java Proxies - java.lang.ClassCastException: $Proxy374 cannot be cast to ...

    [ https://issues.apache.org/jira/browse/GROOVY-5410?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17311646#comment-17311646 ] 

Eric Milles commented on GROOVY-5410:
-------------------------------------

Branch for WIP: https://github.com/apache/groovy/tree/GROOVY-5410

> Groovy Generics Not Playing nice with java Proxies - java.lang.ClassCastException: $Proxy374 cannot be cast to ...
> ------------------------------------------------------------------------------------------------------------------
>
>                 Key: GROOVY-5410
>                 URL: https://issues.apache.org/jira/browse/GROOVY-5410
>             Project: Groovy
>          Issue Type: Bug
>          Components: groovy-runtime
>            Reporter: Craig Rykal
>            Assignee: Eric Milles
>            Priority: Major
>         Attachments: groovy.zipx
>
>
> We are taking a current Spring based application and starting to introduce "Groovy" spring beans.  We ran into this ClassCastException when trying to call a generic method on our Groovy bean that has been wrapped by the JdkDynamicAopProxy.  
> I was able to reproduce with Java/Groovy and the base java.reflect.Proxy classes.
> Attached are all of my simple test classes that demostrate the issue as well as a Spock test(GroovyIssuesSpec.groovy) that shows the problem as well.
> We've had to create a hack to override how Spring proxies it's beans to ignore the fact that these beans are GroovyObjects(Removing GroovyObject.class from the list of proxiedInterfaces, for some reason works around the issue).  The sooner we can get rid of that hack, the better.
> Thanks!



--
This message was sent by Atlassian Jira
(v8.3.4#803005)