Posts Tagged ‘class loader’

Class.forName in Groovy

March 1, 2010

Class.forName(className) does not work properly in Groovy. If you type Class.forName, the JVM does not use the correct class loader.

The solution is to use this instead:

Thread.currentThread().contextClassLoader.loadClass(className)

Advertisements