Created
October 4, 2012 22:24
-
-
Save sergiomichels/3836857 to your computer and use it in GitHub Desktop.
Load domain class in groovy class
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //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