当前位置:首页 > 开发 > 系统架构 > 架构 > 正文

Class loaders

发表于: 2012-06-15   作者:cute.spring   来源:转载   浏览次数:
摘要: Class loaders Class loaders find and load class files. Class loaders enable applications that are deployed on servers to access repositories of available classes and resources. Application develope
Class loaders

Class loaders find and load class files. Class loaders enable applications that are deployed on servers to access repositories of available classes and resources. Application developers and deployers must consider the location of class and resource files, and the class loaders used to access those files, to make the files available to deployed applications.

This topic provides the following information about class loaders in WebSphere® Application Server:

    Class loaders used and the order of use
    Class preloading
    Class-loader isolation policies
    Class-loader modes

Class loaders used and the order of use

The runtime environment of WebSphere Application Server uses the following class loaders to find and load new classes for an application in the following order:

    The bootstrap, extensions, and CLASSPATH class loaders created by the Java virtual machine

    The bootstrap class loader uses the boot class path (typically classes in jre/lib) to find and load classes. The extensions class loader uses the system property java.ext.dirs (typically jre/lib/ext) to find and load classes. The CLASSPATH class loader uses the CLASSPATH environment variable to find and load classes.


Each class loader is a child of the previous class loader. That is, the application module class loaders are children of the WebSphere extensions class loader, which is a child of the CLASSPATH Java class loader. Whenever a class needs to be loaded, the class loader usually delegates the request to its parent class loader. If none of the parent class loaders can find the class, the original class loader attempts to load the class. Requests can only go to a parent class loader; they cannot go to a child class loader. If the WebSphere extensions class loader is requested to find a class in a J2EE module, it cannot go to the application module class loader to find that class and a ClassNotFoundException error occurs. After a class is loaded by a class loader, any new classes that it tries to load reuse the same class loader or go up the precedence list until the class is found.

http://publib.boulder.ibm.com/infocenter/wsdoc400/v6r0/index.jsp?topic=/com.ibm.websphere.iseries.doc/info/ae/ae/crun_classload.html

http://pic.dhe.ibm.com/infocenter/wasinfo/v8r0/index.jsp?topic=%2Fcom.ibm.websphere.base.doc%2Finfo%2Faes%2Fae%2Fttrb_classload_viewer.html

If the class loaders that load the artifacts of an application are not configured properly, the Java virtual machine (JVM) might throw a class loading exception when starting or running that application. Class loading exceptions describes the types of exceptions caused by improperly configured class loaders and suggests ways to use the class loader viewer to correct configurations of class loaders. The types of exceptions include:

    ClassCastException
    ClassNotFoundException
    NoClassDefFoundException
    UnsatisfiedLinkError

Class loaders

  • 0

    开心

    开心

  • 0

    板砖

    板砖

  • 0

    感动

    感动

  • 0

    有用

    有用

  • 0

    疑问

    疑问

  • 0

    难过

    难过

  • 0

    无聊

    无聊

  • 0

    震惊

    震惊

编辑推荐
Class loader in WebSphere Portal WebSphere Portal Express classloading follows the WebSphere
by Andreas Schaefer 11/12/2003 This series of articles started when I wanted to write a weblog
A Java compiler converts source instructions for the Java virtual machine. The virtual machin
原创作品,允许转载,转载时请务必以超链接形式标明文章 原始出处 、作者信息和本声明。否则将追究
Class.class.isInstance(Class.class) // true This means that the class object for Class is an
Class.class.isInstance(Object.class); // true 可转换为Class类对象 Object.class.isAssignableFr
写在前面 最近在通过angularjs将数据绑定到前端,其中也涉及到很多新的东西,一些效果还是很有必要
Class loading is one of the most powerful mechanisms provided by the Java language specificat
Thanks forBinildas Christudas,Link:"http://onjava.com/pub/a/onjava/2005/01/26/classloading.h
1. Explain Java class loader? Class loader are hierarchical and use a delegation model when
版权所有 IT知识库 CopyRight © 2009-2015 IT知识库 IT610.com , All Rights Reserved. 京ICP备09083238号