i have this test code:
@Grab(group='org.codehaus.groovy.modules.http-builder', module='http-builder', version='0.5.1' )
import java.util.concurrent.ExecutorService
import java.util.concurrent.Executors
import groovyx.net.http.HTTPBuilder
ExecutorService executor = Executors.newCachedThreadPool()
(1..10).each {
executor.execute(new Runnable(){
void run() {
def http = new HTTPBuilder('http://www.google.com')
}
})
}
executor.shutdown()
most of the times, but not always i get a LinkageError
Exception in thread "pool-1-thread-8" java.lang.LinkageError: loader (instance of org/codehaus/groovy/tools/RootLoader): attempted duplicate class definition for name: "org/apache/commons/logging/impl/LogFactoryImpl"
In this example i am using Grape, but i tried by adding the jars of HttbBuilder directly to classpath too and i get the same problem.
It is possible to resolve in some way? As i said the strange fact is it happens a lot of times but not always.
Thanks for the help