1 Reply Latest reply: Apr 18, 2012 2:42 AM by René van Wijk RSS

    Classloading in WLS

    Jcgeorge-Oracle
      We have a web applicaton deployed on WLS.

      we have added few jar files inside WEB-INF/lib directory of the application war. Within our app , we have a requirement to scan through the jar files (inside WEB-INF/lib) manifests and detects something.

      Is it guaranteeing that all the Jar files inside WEB-INF/lib is loaded into application class loader?
      If yes, can i get hold of the application classloader from within a java class inside the Web application ?
      Thanks

      Joseph George
        • 1. Re: Classloading in WLS
          René van Wijk
          "Is it guaranteeing that all the Jar files inside WEB-INF/lib is loaded into application class loader?"

          Note that this depends on which classes (jars) you have in the WEB-INF/lib directory. WebLogic uses the delegation
          model to load classes; when classes are already loaded, they do not get loaded again by the application class loader.

          WebLogic provides an override mechanism by the so-called filtering class loader configuration. Some examples are given here:
          - http://middlewaremagic.com/weblogic/?p=5861
          - http://middlewaremagic.com/weblogic/?p=6725

          "... can i get hold of the application classloader from within a java class inside the Web application ?"

          Very good question. Not to my knowledge - http://docs.oracle.com/cd/E21764_01/web.1111/e13706/classloading.htm#i1080994