code: public static Class<?> loadClassByName(String className) throws ClassNotFoundException {
          try {
              return Class.forName(className);
          } catch (ClassNotFoundException e) {
              return Thread.currentThread().getContextClassLoader().loadClass(className);
          }
      }
docs: Load Class by class name. If class not found in it's Class loader or one of the parent class loaders - delegate to the Thread's ContextClassLoader
  
  @param className Canonical class name
  @return Class definition of className
  @throws ClassNotFoundException