Personally, the ultimate test in Java program is the mastery and flexible use of the ClassLoader mechanism, especially in complex systems, such as dynamic mount, Reflect, EJB, AOP, etc. Class.Forname () and thread.currentthread (). Are the getContextClassLoader ())? In many articles, they think that both are consistent, such as an article in the Java Research organization, I was searched from Google: http://www.javaresearch.org/article/showArticle.jsp?column=31&thread= 10178 Wen said, "This method can be replaced with class.Forname ()," in general simple situations, but actually sometimes replaces. ClassLoader has the following question: There may be multiple ClassLoader in a JVM, each ClassLoader has its own namespace. A ClassLoad can only have an instance of a Class object type, but different ClassLoad may have the same Class object instance, which may result in fatal problems. For example, ClassLoadera, the type example A1 is loaded, and ClassLoaderb has also loaded the object instance A2 of class A. Logically A1 = A2, but since A1 and A2 come from different ClassLoaders, they are actually completely different. If a static variable C is defined in A, C is different in different ClassLoaders. Therefore, study the ClassLoader strategy of JBoss, for better implementation of EJB component assembly, because in a project may use other project EJB components, how to achieve runtime EJB component sharing, how to implement EJB component package is very important. To illustrate that ClassLoader is a key to the complex architecture, the SERVIVIVESMANAGER class content in Open Source Portal Product EXO is enumerated. Exo class is implemented using PicoCOntainer functional Service JavaBeans initialization, when the nature of JavaBeans Service that is loaded into the pico is necessary to use the Classloader, Exo specially set a ServiceContext class: public class ServiceContext {private ClassLoader cl; // contains Classloader information private Services services; public ServiceContext (ClassLoader cl, Services services) {this.cl = cl; this.services = services;} public ClassLoader getCl () {return cl;} public Services getServices () {return services;}} in ServicesManager, there is: Private ClassLoader UpdatedClassLoader; its initial value is: thread.currentthread (). GetContextClassLoader (); if, you should write class.Forname so simple, then you headache.