throw new ClassNotFoundException(className + " not found in " + urls);
throw new ClassNotFoundException(className + " not found in " + this);
  protected Class findClass(final String className)    throws ClassNotFoundException  {    // Just try to find the resource by the (almost) same name    String resourceName = className.replace('.', '/') + ".class";    Resource resource = findURLResource(resourceName);    if (resource == null)      throw new ClassNotFoundException(className + " not found in " + urls);    // Try to read the class data, create the CodeSource, Package and    // construct the class (and watch out for those nasty IOExceptions)    try      {	byte[] data;	InputStream in = resource.getInputStream();	try	  {	int length = resource.getLength();	if (length != -1)	  {	    // We know the length of the data.	    // Just try to read it in all at once	    data = new byte[length];	    int pos = 0;		while (length - pos > 0)	      {		int len = in.read(data, pos, length - pos);		if (len == -1)		  throw new EOFException("Not enough data reading from: "					 + in);		pos += len;	      }	  }	else	  {	    // We don't know the data length.	    // Have to read it in chunks.	    ByteArrayOutputStream out = new ByteArrayOutputStream(4096);		byte[] b = new byte[4096];	    int l = 0;	    while (l != -1)	      {		l = in.read(b);		if (l != -1)		  out.write(b, 0, l);	      }	    data = out.toByteArray();	  }	  }	finally	  {	    in.close();	  }	final byte[] classData = data;	// Now get the CodeSource	final CodeSource source = resource.getCodeSource();		// Find out package name	String packageName = null;	int lastDot = className.lastIndexOf('.');	if (lastDot != -1)	  packageName = className.substring(0, lastDot);		if (packageName != null && getPackage(packageName) == null)	  {	    // define the package	    Manifest manifest = resource.loader.getManifest();	    if (manifest == null)	      definePackage(packageName, null, null, null, null, null, null,	                    null);	    else	      definePackage(packageName, manifest, resource.loader.baseURL);	  }		// And finally construct the class!	SecurityManager sm = System.getSecurityManager();        Class result = null;	if (sm != null && securityContext != null)	  {            result = (Class)AccessController.doPrivileged	      (new PrivilegedAction()		{		  public Object run()		  {		    return defineClass(className, classData,				       0, classData.length,				       source);		  }		}, securityContext);	  }	else          result = defineClass(className, classData, 0, classData.length, source);        super.setSigners(result, resource.getCertificates());        return result;      }    catch (IOException ioe)      {	throw new ClassNotFoundException(className, ioe);      }  }