`
阅读更多
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

    文章《2015-11-ClassLoaders-Selajev.pdf》详细解释了Java类加载机制以及类是如何在JVM中被定位、加载和运行的。读者通过这篇文章能够全面掌握classloader的特性,以及如何在Java应用程序中有效地利用类加载器来处理...

    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...

    webshpere classloader 原理

    在探讨WebSphere Application Server v6中的ClassLoaders之前,我们首先简要回顾一下ClassLoaders的基本概念及其在Java虚拟机(JVM)中的作用。 **ClassLoaders**是Java虚拟机的一部分,它们负责查找并加载类文件。...

    java classloader讲义-淘宝网

    本文将通过淘宝网的实际应用场景,深入讲解ClassLoaders的工作原理及其在实际应用中的作用。 #### 二、ClassLoaders的类型 Java中的类加载器主要分为以下几种: 1. **Bootstrap ClassLoader**:启动类加载器,由...

    Java虚拟机工作原理详解.doc

    此外,用户还可以自定义User-Defined Class Loaders来加载特定的类。 类加载器之间采用委派模式。当一个类加载器收到加载类的任务时,它会先委托给父类加载器检查,只有当父类加载器无法找到该类时,才会尝试自己...

    Java技术----实现JAVA的动态类载入机制

    首先,我们要理解Java类加载器(Class Loaders)的角色。在Java中,类加载器负责查找并加载类的字节码文件(.class文件)。这些字节码文件通常位于类路径(ClassPath)中定义的位置。Java虚拟机(JVM)有多个内置的...

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

    在JavaScript编程中,类加载器(Class Loaders)是一个关键的概念,它负责查找、加载和实例化类。在"single-class-loaders"这个项目中,我们看到的是一个专注于简化类管理的解决方案,使得开发者能够更加方便地在...

    java调用外部jar文件

    这个过程涉及到类加载器(Class Loaders)的概念,它是Java虚拟机(JVM)的一个核心特性。下面将详细介绍如何在Java程序中调用外部jar文件。 首先,了解Java类加载器的工作原理是必要的。默认情况下,Java的系统类...

    Tomcat 5.0.18 ClassLoader source code insight

    首先,ClassLoaders在Java中起着至关重要的作用,它们负责查找和加载类到JVM中。Tomcat的ClassLoader设计独特,因为它需要处理Web应用程序的隔离性和安全性。在Tomcat中,每个Web应用程序都有一个独立的ClassLoader...

    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 ...

    深入Java虚拟机.pdf

    它包括了类型安全性、类装载器体系(Class Loaders)、类校验器(Class Verifiers)、安全管理器(Security Managers)、访问控制器(Access Controllers)和代码签名(Code Signing)等技术。这个模型确保了在执行...

    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 ...

    webMethods Integration Server8.2

    webMethods Integration Server 8.2中的类加载器包括OSGi Bundle ClassLoader和Integration Server ClassLoaders。这两种类加载器处理类加载任务,确保了类的安全加载和动态替换。Classpaths是类加载器查找类文件的...

    ClassLoader运行机制 自己写的

    4. WebLogic特定的ClassLoaders: - Ear ClassLoader:加载EAR应用的全局库(如lib目录下的JAR文件)。 - War ClassLoader:加载WAR应用的类,包括WEB-INF/classes和WEB-INF/lib下的JAR文件。 - EJB ClassLoader...

    Java-Reflection-Tutorial.pdf

    10. **类加载器(Class Loaders)** - 类加载器负责加载类到JVM,反射允许自定义类加载策略。 11. **动态代理(Dynamic Proxies)** - Java反射API提供`java.lang.reflect.Proxy`类,用于创建动态代理类,实现...

    安卓逆向学习笔记之ART定制方案比较和流程.docx

    这通常涉及到ClassLoader的作用域问题,不同的ClassLoaders可能会加载不同的.so文件。因此,分析当前加载的.so文件所在的ClassLoader是非常重要的。 ```java // 示例代码,用于获取当前加载的.so文件路径 String ...

    java高新技术.txt

    加载器 (Class Loaders) Java 类加载器负责将 Java 类加载到 JVM 中。 #### 类加载器的层次结构 - Bootstrap ClassLoader: 负责加载 Java 核心类库。 - Extension ClassLoader: 负责加载扩展类库。 - Application...

    关于java安全的程序和文档2.rar_java 安全

    Java安全框架包括安全管理器(Security Manager)、类加载器(Class Loaders)以及权限(Permissions)。安全管理器是实现细粒度控制的关键,可以通过设置策略文件来决定哪些操作是允许的。开发者应该理解何时以及...

Global site tag (gtag.js) - Google Analytics