• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

classloader inversion

 
Paulo Jiang
Greenhorn
Posts: 1
Hibernate Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can anybody please explain the following paragraph from "core java volume II 8th edtion" Page 759


/////////////////////////////////

Your application code contains a helper method that calls Class.forName(classNameString).

That method is called from a plugin class.

The classNameString specifies a class that is contained in the plugin JAR.

The author of the plugin has the reasonable expectation that the class should be loaded. However, the helper method's class was loaded by the system class loader, and that is the class loader used by Class.forName. The classes in the plugin JAR are not visible. This phenomenon is called classloader inversion ......

////////////////////////////////


From my understanding, if "the helper method's class was loaded by the system class loader", then the plugin jar it is in must be placed in the CLASSPATH, and also if "The classNameString specifies a class that is contained in the plugin JAR" then these two classes should be both in the same jar file, which is in CLASSPATH, then why "The classes in the plugin JAR are not visible"

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic