• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

classloader inversion

 
Greenhorn
Posts: 1
Hibernate Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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"

 
reply
    Bookmark Topic Watch Topic
  • New Topic