JBoss Community

Module Compatible Classloading Guide

new comment by David Bosschaert View all comments on this document

In addition to the above, Class.forName("org.foo.SomeClass") will cause issues in modular classloading environments if the defining classloader doesn't have classloading delegation set up to the module that's holding the "org.foo.SomeClass" class.

This problem is solved by using the Class.forName("org.foo.SomeClass", classLoader) overload instead.