Skip to content

Instantly share code, notes, and snippets.

@sergiomichels
Created October 4, 2012 22:24
Show Gist options
  • Select an option

  • Save sergiomichels/3836857 to your computer and use it in GitHub Desktop.

Select an option

Save sergiomichels/3836857 to your computer and use it in GitHub Desktop.
Load domain class in groovy class
//this will throw ClassNotFoundException
Class clazz = Class.forName(className)
//but this will load the class with success
Class clazz = Class.forName(className, true, Thread.currentThread().contextClassLoader)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment