`
阅读更多
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
分享到:
评论

相关推荐

    2015-11-ClassLoaders-Selajev.pdf

    针对Java ClassLoaders的学习文章,让你全面掌握classloader的特性

    java高手必备知识点

    1. 你需要精通面向对象分析与设计(OOA/OOD)、涉及模式(GOF,J2... 你应该了解JVM、classloaders、classreflect以及垃圾回收的基本工作机制等。你应该有能力反编译一个类文件并且明白一些基本的汇编指令。 .........

    Dynamic Class Loading in the JavaTM Virtual Machine

    Class loaders are a powerful mechanism for dynamically loading software components on the Java platform. They are unusual in supporting all of the following features: laziness, type-safe linkage, user...

    学习java的30个目标

    你应该了解JVM,classloaders,classreflect,以及垃圾回收的基本工作机制等。你应该有能力反编译一个类文件并且明白一些基本的汇编指令。  4.如果你将要写客户端程序,你需要学习WEB的小应用程序(applet),必需...

    Java加载。jar包

    在jdk1.2以后,类加载是通过委托来完成的,这意味着如果 ClassLoader 不能找到类,它会请求父代 ClassLoader 来执行此项任务,所有 ClassLoaders 的根是系统 ClassLoader,它会以缺省方式装入类 -- 即,从本地文件...

    单例模式,single

    在本月的专栏中,David Geary探讨了单例模式以及在面对多线程(multithreading)、类装载器(classloaders)和序列化(serialization)时如何处理这些缺陷。 单例模式适合于一个类只有一个实例的情况,比如窗口管理器...

    Pro+Spring+Dynamic+Modules+for+OSGi+Service+Platforms

    Java, requiring the use of custom class loaders. With OSGi this is not the case. No longer will you need to check your CLASSPATH variable to avoid running multiple JARs with the same name that may ...

    Core Java Volume II Advanced Features__10th edition

    •Enforce security via class loaders, bytecode verification, security managers, permissions, user authentication, digital signatures, code signing, and encryption •Master advanced Swing components ...

    java7帮助文档

    see Multithreaded Custom Class Loaders in Java SE 7. Java Programming Language The following enhancements have been added to the Java language: Binary Literals Underscores in Numeric Literals ...

    Java2核心技术卷I+卷2:基础知识(第8版) 代码

    Class Loaders 756 Bytecode Verification 767 Security Managers and Permissions 771 User Authentication 790 Digital Signatures 805 Code Signing 822 Encryption 828 Chapter 10: Distributed ...

    OSGI_Java.zip_java programming_osgi document

    OSGi document describing the modular system & service platform (plugins, classloaders, etc) used for Java programming.

    初探Java类加载机制

    一、在jdk1.2以后,类加载是通过委托来完成的,这意味着如果 ClassLoader 不能找到类,它会请求父代 ClassLoader 来执行此项任务,所有 ClassLoaders 的根是系统 ClassLoader,它会以缺省方式装入类 — 即,从本地...

    java单例模式完全剖析

    单例模式是最简单的设计模式之一,但是对于Java的开发者来说...在本月的专栏中,David Geary探讨了单例模式以及在面对多线程(multithreading)、类装载器(classloaders)和序列化(serialization)时如何处理这些缺陷。

    single-class-loaders:只需将类添加到任何容器即可添加加载器和状态

    单类加载器 只需将类添加到任何容器即可添加加载器和状态

    jQuery SVG实现Loading加载按钮动画图标特效.zip

    <div class="loaders"> <h2>Loaders <input type="radio" name="loaders" value="circular-loading" checked="checked"/> <span>circular <input type="radio" name="loaders" value="circle-...

    最新苹果CMS海螺模版V20修复版源码 加广告代码.zip

    <div class="ggimg"> 图片链接"> 图片链接"> 图片链接"> 图片链接"> .ads.ads_w { max-height: 100% !important; } .ggimg { width: 100%; border-radius: 4px; } .ggimg a { ...

    《Velocity1.4 java开发指南》中文版

    1.开始入门 3 ...1.Why Can't I Access Class Members and Constants from VTL? 32 2.Where does Velocity look for Templates? 33 16.Summary 33 17.Appendix 1 : Deploying the Example Servlet 33

    Webpack中loader打包各种文件的方法实例

    使用webpack时,在main.js文件中直接使用如下代码导入了style.css文件,控制台中显示如下错误:You may need an appropriate loader to handle this file type, currently no loaders are configured to process ...

    dom-element-loader:将HTML加载为Webpack 4+的DOM elementnode的最简单方法

    DOM元素加载器 ... < div class =' sexy '> this div gonna be import in your js as DOM element 安装 npm install --save dom-element-loader module . exports = { //.. module : { //.. loaders :

    es6-loader:用于 webpack 的 ES6 模块加载器

    class Panda { constructor ( arg = 'default' ) { this . eat = bamboo ; }}export default Panda ; var Panda = require ( 'es6!./panda.js' ) . default ;new Panda ( ) . eat ( ) ; 或者在 webpack 配置中: ...

Global site tag (gtag.js) - Google Analytics