Q:

Groovy Extension Module Method - No Signature of Method

I've created two groovy extension modules / methods on java.util.ArrayList(). It's all working very well inside my IDE. I use gradle to build the jar, and deploy it to a remote JVM.  When it reaches the remote JVM, it fails. 
Here is the extension method: 
    static Map sumSelectedAttributes(final List self, List attributes) {
    Map resultsMap = [:]
    attributes.each { attr ->
        resultsMap[attr] = self.inject(0) { sum, obj ->
            sum + obj[attr]
        }
    }
    return resultsMap

Here is the code that invokes it: 
outputMap[processName][iName] << kBeanList.sumSelectedAttributes([
    "messageCount", "userCount", "outstandingRequests",
    "cpuUsage", "memoryUsage", "threadCount", "cacheCount", "huserCount",
    "manualHuserCount", "dataPointerCount", "tableHandleCount",
    "jdbCacheRecordCount", "dbConnectionCount"])

Here is the error: 

No signature of method: java.util.ArrayList.sumSelectedAttributes() is
  applicable for argument types: (java.util.ArrayList) values:
  [[messageCount, incomingConnectionsCount, outgoingConnectionsCount,
  ...]]

Again, it works fine in intellij with test cases. What is different on the remote JVM that would prevent this from working?  Here are some things that came to my mind: 

The remote JVM uses Groovy 2.3 while I'm on 2.4.5
We use a custom classloader on the remote JVM to load classes

Other than that, I could not find any other documentation about anything special I need to do to make extensions work on remote JVM's. 
Any help is greatly appreciated. 
Per a comment, seems like an issue with custom classloader, here is the class that handles the manipulation of a few classloaders. 
class CustomLoader {
    static Map loaders = [:]
    static File loaderRoot = new File("../branches")

    static URLClassLoader getCustomLoader(String branchName) {
        if (!loaders[branchName]) {
            loaders[branchName] = new URLClassLoader(getUrls(branchName))
        } else {
            loaders[branchName]
        }
    }

    static URLClassLoader updateClassLoader(String branchName) {
        loaders[branchName] = null
        loaders[branchName] = new URLClassLoader(getUrls(branchName))
    }

    private static URL[] getUrls(String branchName) {
        def loaderDir = new File(loaderRoot, branchName)
        List<File> files = []
        loaderDir.eachFileRecurse{
            if (it.name.endsWith('.jar')) {
                files  << it
            }
        }
        List urls = files.sort{ it.name }.reverse().collect{it.toURI().toURL()}
        return urls
    }
}

A:

To manually register an extension method module you can use code similar to what is used in GrapeIvy. Because grapes have the same problem in that they make a jar visible in the wrong loader but still want to enable extension methods. The piece of code in question is this here:
JarFile jar = new JarFile(file)
def entry = jar.getEntry(ExtensionModuleScanner.MODULE_META_INF_FILE)
if (entry) {
  Properties props = new Properties()
  props.load(jar.getInputStream(entry))
  Map<CachedClass, List<MetaMethod>> metaMethods = new HashMap<CachedClass, List<MetaMethod>>()
  mcRegistry.registerExtensionModuleFromProperties(props, loader, metaMethods)
  // add old methods to the map
  metaMethods.each { CachedClass c, List<MetaMethod> methods ->
    // GROOVY-5543: if a module was loaded using grab, there are chances that subclasses
    // have their own ClassInfo, and we must change them as well!
    Set<CachedClass> classesToBeUpdated = [c]
    ClassInfo.onAllClassInfo { ClassInfo info ->
      if (c.theClass.isAssignableFrom(info.cachedClass.theClass)) {
        classesToBeUpdated << info.cachedClass
      }
    }
    classesToBeUpdated*.addNewMopMethods(methods)
  }
}

In this code file is a File representing the jar. In your case you will need to have something else here. Basically we first load the descriptor file into Properties, call registerExtensionModuleFromProperties to fill the map with MetaMethods depending on a given class loader. And that is the key part for the solution of your problem, the right class loader here is one that can load all the classes in your extension module and the groovy runtime!. After this any new meta class will know about the extension methods. The code that follows is needed only if there are already existing meta classes, you want to know about those new methods.

