code: private ClassLoader getClassLoaderFromBundle(Object resource, String packageName, String versionRange)
      {
      	ClassLoader classLoader = null;
          if (resource == null)
          {
              Object classAccess = this.getClassBundleService(null, packageName + FAKE_CLASSNAME, versionRange, null, 0);
              if (classAccess != null)
              {
              	classLoader = classAccess.getClass().getClassLoader();
              }
          }
          else
          {
          	Bundle bundle = this.findBundle(resource, bundleContext, packageName, versionRange);
          	if (bundle == null)
          		return null;
          	@SuppressWarnings("unchecked")
  			Enumeration<URL> entries = bundle.findEntries(packageName.replace('.', '/'), "*.class", true);
          	if (entries != null)
          		if (entries.hasMoreElements())
          	{	// This is kind of a hokey way to get the classloader from a bundle - find a class file and load it - but it works.
          		URL url = entries.nextElement();
          		String path = url.getFile();
          		int start = path.startsWith("/") ? 1 : 0;	// Path should always start at the root.
          		path = path.substring(start, path.lastIndexOf('.')).replace('/', '.');
          		try {
  					classLoader = bundle.loadClass(path).getClassLoader();
  				} catch (ClassNotFoundException e) {
  					e.printStackTrace();
  				}
          	}
          }
          return classLoader;
      }
docs: Find this class's bundle in the repository
  @param versionRange version
  @param className
  @return