Hi, we have Groovy integrated as a scripting engine in a server software product. A customer of us reports errors that occur casually in their Groovy scripts and then persist. Restarting the server JVM seems to fix the error for some time until it occurs again.
The exceptions that occur are strange. They report supposedly overlapping prototypes which do not exist. The class that implements the overloaded methods contains four methods named `executeAndGetScalarValue`: * executeAndGetScalarValue(JdbcConnection, String) * executeAndGetScalarValue(JdbcConnection, String, Object) * executeAndGetScalarValue(JdbcConnection, String, Closure<?>) * executeAndGetScalarValue(JdbcConnection, String, Object, Closure<?>) Groovy claims two overlapping methods with the very same signature: [interface de.uplanet.jdbc.JdbcConnection, class java.lang.String, class java.lang.Object, class groovy.lang.Closure] [interface de.uplanet.jdbc.JdbcConnection, class java.lang.String, class java.lang.Object, class groovy.lang.Closure] groovy.lang.GroovyRuntimeException: Ambiguous method overloading for method de.uplanet.lucy.server.util.db.DbQuery#executeAndGetScalarValue. Cannot resolve which method to invoke for [class de.uplanet.jdbc.JdbcConnectionImpl, class java.lang.String, class java.lang.Integer, class script1C78558496CB4905E2BDF40F941C16245DFC3BA5$_run_closure1] due to overlapping prototypes between: [interface de.uplanet.jdbc.JdbcConnection, class java.lang.String, class java.lang.Object, class groovy.lang.Closure] [interface de.uplanet.jdbc.JdbcConnection, class java.lang.String, class java.lang.Object, class groovy.lang.Closure] at groovy.lang.MetaClassImpl.doChooseMostSpecificParams(MetaClassImpl.java:3279) ~[groovy-2.5.6-indy.jar:2.5.6] at groovy.lang.MetaClassImpl.chooseMostSpecificParams(MetaClassImpl.java:3256) ~[groovy-2.5.6-indy.jar:2.5.6] at groovy.lang.MetaClassImpl.chooseMethodInternal(MetaClassImpl.java:3245) ~[groovy-2.5.6-indy.jar:2.5.6] at groovy.lang.MetaClassImpl.chooseMethod(MetaClassImpl.java:3188) ~[groovy-2.5.6-indy.jar:2.5.6] at groovy.lang.MetaClassImpl.getNormalMethodWithCaching(MetaClassImpl.java:1399) ~[groovy-2.5.6-indy.jar:2.5.6] at groovy.lang.MetaClassImpl.getMethodWithCaching(MetaClassImpl.java:1314) ~[groovy-2.5.6-indy.jar:2.5.6] at org.codehaus.groovy.vmplugin.v7.Selector$MethodSelector.chooseMeta(Selector.java:593) ~[groovy-2.5.6-indy.jar:2.5.6] at org.codehaus.groovy.vmplugin.v7.Selector$MethodSelector.setCallSiteTarget(Selector.java:990) ~[groovy-2.5.6-indy.jar:2.5.6] at org.codehaus.groovy.vmplugin.v7.IndyInterface.selectMethod(IndyInterface.java:230) ~[groovy-2.5.6-indy.jar:2.5.6] at script1C78558496CB4905E2BDF40F941C16245DFC3BA5.run(script1C78558496CB4905E2BDF40F941C16245DFC3BA5.groovy:11) ~[?:?] at jdk.internal.reflect.GeneratedMethodAccessor295.invoke(Unknown Source) ~[?:?] at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?] at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?] at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:101) ~[groovy-2.5.6-indy.jar:2.5.6] at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:323) ~[groovy-2.5.6-indy.jar:2.5.6] at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1217) ~[groovy-2.5.6-indy.jar:2.5.6] at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1041) ~[groovy-2.5.6-indy.jar:2.5.6] at org.codehaus.groovy.runtime.InvokerHelper.invokePogoMethod(InvokerHelper.java:1011) ~[groovy-2.5.6-indy.jar:2.5.6] at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:994) ~[groovy-2.5.6-indy.jar:2.5.6] I've no idea what might trigger this error. My best guess is that this might be a bug in Groovy. The Groovy version is 2.5.6. Any ideas? -- Best regards, Alex