You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Joseph Athman (JIRA)" <ji...@apache.org> on 2015/11/10 17:12:11 UTC

[jira] [Commented] (GROOVY-6286) Cannot call Java static method with same name as inner class (LinkageError)

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

Joseph Athman commented on GROOVY-6286:
---------------------------------------

Hystrix has gained quite a bit of popularity recently, would it be possible to get a fix for this in Groovy?

> Cannot call Java static method with same name as inner class (LinkageError)
> ---------------------------------------------------------------------------
>
>                 Key: GROOVY-6286
>                 URL: https://issues.apache.org/jira/browse/GROOVY-6286
>             Project: Groovy
>          Issue Type: Bug
>          Components: groovy-runtime
>    Affects Versions: 2.1.6, 2.2.0-beta-1, 2.3.7, 2.4.0-rc-1
>            Reporter: David Carr
>         Attachments: groovy-bug.zip
>
>
> When you attempt to do so, you get an exception like this:
> {code}
> Exception in thread "main" java.lang.LinkageError: loader constraint violation: when resolving method "svc.Responder.Setter()Lsvc/Responder$Setter;" the class loader (instance of org/codehaus/groovy/runtime/callsite/CallSiteClassLoader) of the current class, svc/Responder$Setter, and the class loader (instance of sun/misc/Launcher$AppClassLoader) for resolved class, svc/Responder, have different Class objects for the type org/codehaus/groovy/runtime/callsite/CallSiteClassLoader used in the signature
> 	at svc.Responder$Setter.call(Unknown Source)
> 	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
> 	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
> 	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:112)
> 	at app.Main.main(Main.groovy:7)
> {code}
> A simple project with a Java class, a Groovy class, and a Gradle build is attached that can reproduce this situation.  To see the error, just run "gradlew run".
> In the real world, this occurs when trying to use Hystrix's HystrixCommandProperties.Setter() method from Groovy (in my case, Grails).
> https://github.com/Netflix/Hystrix/blob/master/hystrix-core/src/main/java/com/netflix/hystrix/HystrixCommandProperties.java



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)