On 2021/05/05 11:10:38, Alexander Veit <[email protected]> wrote: > Paul King wrote:>
> > I would guess two versions of the class loaded by two different class> > > loaders? Can you describe what if any class loading arrangement the server> > > might have in place?> > > Digging deeper I suspect that the root cause for this error may possibly be a multithreading problem in Groovy's MetaClassImpl.> > > For me the code is not easy to understand, but as far as I can see there seems to be no synchronization involved when methods are being cached in the MetaClassImpl (MetaMethodIndex/FastArray). Could missing thread-safety explain the "ambiguous method overloading" error thrown by doChooseMostSpecificParams?> > > > -- > > Cheers,> > Alex> > I've also just started encountering this issue. It happens intermittently on 1 instance of this exact same code version deployed (same docker container deployed in multiple places). Restarting the JVM is the only way to fix the problem once it's occurred. I've verified with ClassGraph ( https://github.com/classgraph/classgraph) that there isn't a duplicate class within the classpath for anything stated in the error message. I too am leaning to it being some type of race condition within the MetaClassImpl code where a duplicate cache entry is somehow being created. Error message: groovy.lang.GroovyRuntimeException: Ambiguous method overloading for method ratpack.http.client.internal.RequestConfig$Spec#sslContext. Cannot resolve which method to invoke for [class io.netty.handler.ssl.JdkSslClientContext] due to overlapping prototypes between: [class io.netty.handler.ssl.SslContext] [class io.netty.handler.ssl.SslContext] at groovy.lang.MetaClassImpl.doChooseMostSpecificParams(MetaClassImpl.java:3279) ~[groovy-2.5.6.jar:2.5.6] at groovy.lang.MetaClassImpl.chooseMostSpecificParams(MetaClassImpl.java:3256) ~[groovy-2.5.6.jar:2.5.6] at groovy.lang.MetaClassImpl.chooseMethodInternal(MetaClassImpl.java:3245) ~[groovy-2.5.6.jar:2.5.6] at groovy.lang.MetaClassImpl.chooseMethod(MetaClassImpl.java:3188) ~[groovy-2.5.6.jar:2.5.6] at groovy.lang.MetaClassImpl.getMethodWithCachingInternal(MetaClassImpl.java:1355) ~[groovy-2.5.6.jar:2.5.6] at groovy.lang.MetaClassImpl.createPojoCallSite(MetaClassImpl.java:3434) ~[groovy-2.5.6.jar:2.5.6] at org.codehaus.groovy.runtime.callsite.CallSiteArray.createPojoSite(CallSiteArray.java:131) ~[groovy-2.5.6.jar:2.5.6] at org.codehaus.groovy.runtime.callsite.CallSiteArray.createCallSite(CallSiteArray.java:165) ~[groovy-2.5.6.jar:2.5.6] at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47) ~[groovy-2.5.6.jar:2.5.6] at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:115) ~[groovy-2.5.6.jar:2.5.6] at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:127) ~[groovy-2.5.6.jar:2.5.6] at com.company.client.KubernetesClient$_closure1$_closure41.doCall(KubernetesClient.groovy:58) ~[ratpack-k8s-0.3.2.jar:?] at jdk.internal.reflect.GeneratedMethodAccessor258.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.jar:2.5.6] at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:323) ~[groovy-2.5.6.jar:2.5.6] at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:263) ~[groovy-2.5.6.jar:2.5.6] at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1041) ~[groovy-2.5.6.jar:2.5.6] at groovy.lang.Closure.call(Closure.java:405) ~[groovy-2.5.6.jar:2.5.6] at org.codehaus.groovy.runtime.ConvertedClosure.invokeCustom(ConvertedClosure.java:50) ~[groovy-2.5.6.jar:2.5.6] at org.codehaus.groovy.runtime.ConversionHandler.invoke(ConversionHandler.java:122) ~[groovy-2.5.6.jar:2.5.6] at com.sun.proxy.$Proxy46.execute(Unknown Source) ~[?:?] at ratpack.func.Action.lambda$append$2(Action.java:98) ~[ratpack-exec-1.8.2.jar:?] at ratpack.func.Action.lambda$append$2(Action.java:98) ~[ratpack-exec-1.8.2.jar:?] at ratpack.http.client.internal.RequestConfig.of(RequestConfig.java:69) ~[ratpack-core-1.8.2.jar:?] at ratpack.http.client.internal.RequestActionSupport.<init>(RequestActionSupport.java:76) ~[ratpack-core-1.8.2.jar:?] at ratpack.http.client.internal.ContentAggregatingRequestAction.<init>(ContentAggregatingRequestAction.java:46) ~[ratpack-core-1.8.2.jar:?] at ratpack.http.client.internal.DefaultHttpClient.lambda$request$2(DefaultHttpClient.java:323) ~[ratpack-core-1.8.2.jar:?] at ratpack.exec.internal.DefaultExecution.lambda$upstream$2(DefaultExecution.java:124) ~[ratpack-exec-1.8.2.jar:?] at ratpack.exec.internal.DefaultExecution$SingleEventExecStream.exec(DefaultExecution.java:499) ~[ratpack-exec-1.8.2.jar:?] Environment: Groovy 2.5.6 java -version openjdk version "11.0.11" 2021-04-20 OpenJDK Runtime Environment AdoptOpenJDK-11.0.11+9 (build 11.0.11+9) OpenJDK 64-Bit Server VM AdoptOpenJDK-11.0.11+9 (build 11.0.11+9, mixed mode)
