code: private static BeanInfo loadBeanInfo(String beanInfoClassName,
          Class<?> beanClass) throws Exception{
          try {
              ClassLoader cl = beanClass.getClassLoader();
              if(cl != null){
                  return (BeanInfo) Class.forName(beanInfoClassName, true,
                      beanClass.getClassLoader()).newInstance();
              }
          } catch (Exception e) {
              // fall through
          }
          try {
              return (BeanInfo) Class.forName(beanInfoClassName, true,
                      ClassLoader.getSystemClassLoader()).newInstance();
          } catch (Exception e) {
              // fall through
          }
          return (BeanInfo) Class.forName(beanInfoClassName, true,
                  Thread.currentThread().getContextClassLoader()).newInstance();
      }
docs: /*
  Method which attempts to instantiate a BeanInfo object of the supplied
  classname
  
  @param theBeanInfoClassName -
  the Class Name of the class of which the BeanInfo is an
  instance
  @param classLoader
  @return A BeanInfo object which is an instance of the Class named
  theBeanInfoClassName null if the Class does not exist or if there
  are problems instantiating the instance