Chapter 28 Configuring Custom Java Class Lists


Class loading order

This section describes the loading order for Java components and Web applications. You may find this information useful for troubleshooting class conflicts. For further troubleshooting assistance, enable class-loader tracing as described in "Class loader caveats and troubleshooting".

Class loading order for components

When loading classes required by Java components, the compoment class loader searches for classes in this order:

  1. Any JAR file that is listed in the component's custom class list property and deployed in the EAServer java/classes subdirectory.
  2. Classes listed in the component's custom class list and deployed under the EAServer java/classes subdirectory.
  3. Classes listed in the component's custom class list and deployed under the EAServer html/classes subdirectory.
  4. If the class is not loaded at this point, it is loaded by the system loader using the codebase order specified in the CLASSPATH environment variable for the server process.

Class loading order for Web applications

The custom class loader loads Web application classes by searching the following code bases, in the order specified. All of these locations are subdirectories of your EAServer installation directory, app_name represents the name of your Web application, and server is the server where the Web application is installed. If the custom class loader cannot locate a class file, the server attempts to load it using the system class loader.

  1. Class files in work/server/Servlet/WebApp-app_name

    This directory contains generated servlet classes for compiled JSPs.
  2. Class files in Repository/WebApplication/app_name/WEB-INF/classes

    This is the standard directory for servlet, filter, tag-library, and utility classes used by the Web application. If utility classes are shared with Java components running on the same server, you may wish to move them to the EAServer java/classes subdirectory and add them to the custom class list for your application or server.
  3. JAR files in Repository/WebApplication/app_name/WEB-INF/lib

    JAR files are loaded in the order that they are listed in the com.sybase.jaguar.webapplication.jarlist property. JAR files not listed in this property are loaded in directory order; that is, the order that they are returned in a directory listing.
  4. JAR files in the java/classes directory that are listed in the custom class list for the servlet, JSP, or Web application.
  5. Class files in the java/classes and html/classes directory that are specified in in the custom class list for the servlet, JSP, or Web application.
  6. If the class has not been found, the server attempts to load the class using the system class loader, which searches directories and JAR files listed in the server process's CLASSPATH environment variable.

 


Copyright © 2002 Sybase, Inc. All rights reserved.