Not sure where you got that ClassLoader, but it won't work under Java2; they
changed the ClassLoader rules.

Look at ClassLoader in the API docs; you need to override findClass, not
loadClass; loadClass checks with the ClassLoader's parent to ensure that a
ClassLoader "higher up the chain" can't load the class instead.

<SHAMELESS_PLUG>
I cover ClassLoaders in java 2 to great detail in my upcoming book,
"Server-Side Java": http://www.manning.com/Neward3/ . (Ignore the blurb
that's there now; it's from the wrong book.) Should be out 4Q99.
</SHAMELESS_PLUG>

Ted Neward
Patterns/C++/Java/CORBA/EJB/COM-DCOM spoken here
http://www.javageeks.com/~tneward
"I don't even speak for myself; my wife won't let me." --Me

-----Original Message-----
From: Scott M Stark <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
Date: Tuesday, July 06, 1999 1:58 AM
Subject: Isolated HotSpot crash to ClassLoader.findSystemClass("[")


>This isolated example program reproduces the crash seen with HotSpot +
>a servlet engine and I have submitted this as a bug to Sun(internal review
>ID of: 85224):
>
>
>public class AdaptiveClassLoader extends ClassLoader
>{
> protected synchronized Class loadClass(String name, boolean resolve)
>  throws ClassNotFoundException
> {
>  // The class object that will be returned.
>  Class c = null;
>
>  // Attempt to load the class from the system
>  try
>  {
>System.out.println("loadSystemClass -> ");
>   c = loadSystemClass(name, resolve);
>System.out.println(c);
>   if (c != null)
>   {
>    if (resolve) resolveClass(c);
>    return c;
>   }
>  }
>  catch (Exception e)
>  {
>   c = null;
>  }
>
>  return c;
> }
>
> private Class loadSystemClass(String name, boolean resolve)
>  throws NoClassDefFoundError, ClassNotFoundException
> {
>System.out.println("findSystemClass -> ");
>  Class c = findSystemClass(name);
>System.out.println(c);
>  // Throws if not found.
>
>  if (resolve) resolveClass(c);
>
>  return c;
> }
>
> public static void main(String[] args) throws Exception
> {
>  AdaptiveClassLoader loader = new AdaptiveClassLoader();
>  Class c = loader.loadClass("[");
>  c.newInstance();
> }
>}
>
>
>bash-2.02$ java -version
>java version "1.2.1"
>HotSpot VM (1.0fcs, mixed mode, build E)
>bash-2.02$ java AdaptiveClassLoader
>loadSystemClass ->
>findSystemClass ->
>#
># HotSpot Virtual Machine Error, Internal Error
>#
># Error ID: 4649454C44345950450E4350500026
>#
>bash-2.02$
>
>
>
>
>***************************************************************************
*****
>Bear Stearns is not responsible for any recommendation, solicitation, offer
or
>agreement or any information about any transaction, customer account or
account
>activity contained in this communication.
>***************************************************************************
*****
>
>___________________________________________________________________________
>To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
>of the message "signoff SERVLET-INTEREST".
>
>Archives: http://archives.java.sun.com/archives/servlet-interest.html
>Resources: http://java.sun.com/products/servlet/external-resources.html
>LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to