Exforsys

WebSphere Tutorials

  1. WebSphere V5.0 : Building Expressions
  2. WebSphere V5.0 : Creating SQL statements
  3. WebSphere V5.0 : Applying DDL scripts to a remote database
  4. WebSphere V5.0 : Deploying to the database
  5. WebSphere V5.0 : Defining a table
  6. WebSphere V5.0 : Defining a database
  7. Working with Data in WebSphere
  8. WebSphere V5.0 : Debugging - JSP debugging
  9. WebSphere V5.0 : Debugging - Scrapbook Page
  10. WebSphere V5.0 : Debugging - View variables
  11. WebSphere V5.0 : Debugging - Step-through code
  12. WebSphere V5.0 : Debugging - Set breakpoints
  13. WebSphere V5.0 : Running Applications - Export J2EE applications
  14. WebSphere V5.0 : Running Applications - Run/operate server
  15. WebSphere V5.0 : Running Applications - Understand Session Manager
  16. WebSphere V5.0 : Running Applications - Configure data sources
  17. WebSphere V5.0 : Running Applications - Create server instance and server configuration
  18. WebSphere V5.0 : Web Development - Use Web Page Wizards
  19. WebSphere V5.0 : Web Development - Work with Web Application Deployment Descriptor
  20. WebSphere V5.0 : Web Development - Use content assist
  21. WebSphere V5.0 : Web Development - Use Page Designer to add and modify HTML and JSP content
  22. WebSphere V5.0 : Web Development - Understand classpath and module dependencies
  23. WebSphere V5.0 : Web Development - Create resources in appropriate J2EE locations
  24. WebSphere V5.0 : Web Development - Create a web project
  25. WebSphere V5.0 : Java Development - Use property dialogues
  26. WebSphere V5.0 : Java Development - Use hierarchy view
  27. WebSphere V5.0 : Java Development - Use task view
  28. WebSphere V5.0 : Java Development - Use search function
  29. WebSphere V5.0 : Java Development - Use content assist function and declarations
  30. WebSphere V5.0 : Java Development - Use refactoring features
  31. WebSphere V5.0 : Java Development - Use Outline View and Browsing View
  32. WebSphere V5.0 : Java Development - Create Java project, packages, classes, methods
  33. WebSphere V5.0 : Workbench Basics - Use the Help feature to aid in development activities
  34. WebSphere V5.0 : Workbench Basics - Import to and export from the workbench
  35. WebSphere V5.0 : Workbench Basics - Work with Perspectives
  36. WebSphere V5.0 : Workbench Basics - Set workbench preferences
  37. WebSphere V5.0 : Workbench Basics - Create J2EE projects

Ads


Home arrow Reviews arrow WebSphere Tutorials

WebSphere V5.0 : Web Development - Understand classpath and module dependencies Page - 2

Page 2 of 2
Author : Exforsys Inc.     Published on: 21st Apr 2006

WebSphere V5.0 : Web Development - Understand classpath and module dependencies

Ads

The following example shows that when the application class-loader policy of an application server is set to MULTIPLE, each application on the server has its own class loader. An application class loader also loads its Web modules if the application's WAR class-loader policy is set to APPLICATION. If the policy is set to MODULE, then a Web module uses its own class loader.

Application class-loader policy: MULTIPLE

Application 1
.....Module: EJB1.jar
.....Module: WAR1.war
..........MANIFEST Class-Path: Dependency1.jar
..........WAR Classloader Policy = MODULE

Application 2
.....Module: EJB2.jar
..........MANIFEST Class-Path: Dependency2.jar
.....Module: WAR2.war
..........WAR Classloader Policy = APPLICATION

MULTIPLE

Class-loader modes

There are two possible values for a class-loader mode:

  • PARENT_FIRST
    .
    The PARENT_FIRST class-loader mode causes the class loader to first delegate the loading of classes to its parent class loader before attempting to load the class from its local classpath. This is the default for class-loader policy and for standard JVM class loaders.
    .
  • PARENT_LAST
    .
    The PARENT_LAST class-loader mode causes the class loader to first attempt to load classes from its local classpath before delegating the class loading to its parent. This policy allows an application class loader to override and provide its own version of a class that exists in the parent class loader.

    The following settings determine a class loader's mode:
  • If the application class-loader policy of an application server is SINGLE, the application class-loader policy of an application server defines the mode for an application class loader.
    .
  • If the application class-loader policy of an application server is MULTIPLE, the class-loader mode of an application defines the mode for an application class loader.
    .
  • If the WAR class-loader policy of an application is MODULE, the WAR class-loader policy of a Web module defines the mode for a WAR class loader.

Editing a server configuration

WebSphere Studio provides you with editors so that you may change your server configurations. To edit a server configuration, you can do one of the following:

  • To view the server configurations in the Server Configuration view, click the Menu icon and select View > Advanced. The advanced Server Configuration view opens, displaying the servers and their associated configurations. Double-click on the server configuration in the Server Configuration view.
    .
  • Right-click on the server configuration in the Server Configuration view, and then select Open. .
    .
  • Open with the default text editor or some other system text editor which gives you fine control over the configuration, especially for the parts of the configuration that are not supported by the Server Tools server configuration editors.

Depending on what run-time environment the server configuration is defined to use, or whether it is defined as a local or remote configuration, the fields that you can change may be different.

If you want to run several WebSphere application servers at the same time, you need to change the port settings by selecting the Ports tab located at the bottom of the WebSphere Configuration Editor. For more information about the various port settings, refer to the WebSphere Application Server documentation.

Setting class loader policy for a server

When editing a WebSphere server, you can specify the class loader isolation mode that you want to use for the application server.

1. Double-click on the server in the Server Configuration view. The server editor opens.

2. Click the Configuration tab.

3. You can specify one of the following in the Application class loader policy field:

a. SINGLE for J2EE application mode. Only one Enterprise application class loader for all applications deployed in an application server.

b. MULTIPLE for Compatibility mode. Each enterprise application gets its own application class loader.


Application class loader policy

4. Save and close the editor.

Setting class loader policy for an application on a server

You can define class loader policy for a specific application for a WebSphere test environment or server.

1. In the Server Configuration view or Servers view, double-click the server to open it. The server editor opens.

2. Click the Applications tab at the bottom of the editor.

3. In the Applications list box, select the application to modify the class loader settings.

4. In the Classloader mode field, select the class loading mode for the application:

  • PARENT_FIRST causes the class loader to delegate the loading of classes to its parent class loader before attempting to load the class from its local class path.
    .
  • PARENT_LAST causes the class loader to attempt to load classes from its local class path before delegating the class loading to its parent.

5. In the WAR classloader policy field, select the isolation level of Web modules.

  • If this policy is set to APPLICATION, then the Web project contents also are loaded by the application class loader (in addition to the EJB files, RAR files, dependency JAR files, and shared libraries).
    .
  • If the policy is set to MODULE, then each Web project receives its own class loader whose parent is the application class loader.



WAR class loader policy

Ads

6. In the Start weight field, specify the order in which projects in an J2EE application are started. Lower weighted projects are started before higher weighted projects.

7. Save and close the editor.

_____________
Author: Mikalai Zaikin. Please Click Here to visit Authors site for any updates and changes to the study notes.



 
This tutorial is part of a WebSphere Tutorials tutorial series. Read it from the beginning and learn yourself.

WebSphere Tutorials

  1. WebSphere V5.0 : Building Expressions
  2. WebSphere V5.0 : Creating SQL statements
  3. WebSphere V5.0 : Applying DDL scripts to a remote database
  4. WebSphere V5.0 : Deploying to the database
  5. WebSphere V5.0 : Defining a table
  6. WebSphere V5.0 : Defining a database
  7. Working with Data in WebSphere
  8. WebSphere V5.0 : Debugging - JSP debugging
  9. WebSphere V5.0 : Debugging - Scrapbook Page
  10. WebSphere V5.0 : Debugging - View variables
  11. WebSphere V5.0 : Debugging - Step-through code
  12. WebSphere V5.0 : Debugging - Set breakpoints
  13. WebSphere V5.0 : Running Applications - Export J2EE applications
  14. WebSphere V5.0 : Running Applications - Run/operate server
  15. WebSphere V5.0 : Running Applications - Understand Session Manager
  16. WebSphere V5.0 : Running Applications - Configure data sources
  17. WebSphere V5.0 : Running Applications - Create server instance and server configuration
  18. WebSphere V5.0 : Web Development - Use Web Page Wizards
  19. WebSphere V5.0 : Web Development - Work with Web Application Deployment Descriptor
  20. WebSphere V5.0 : Web Development - Use content assist
  21. WebSphere V5.0 : Web Development - Use Page Designer to add and modify HTML and JSP content
  22. WebSphere V5.0 : Web Development - Understand classpath and module dependencies
  23. WebSphere V5.0 : Web Development - Create resources in appropriate J2EE locations
  24. WebSphere V5.0 : Web Development - Create a web project
  25. WebSphere V5.0 : Java Development - Use property dialogues
  26. WebSphere V5.0 : Java Development - Use hierarchy view
  27. WebSphere V5.0 : Java Development - Use task view
  28. WebSphere V5.0 : Java Development - Use search function
  29. WebSphere V5.0 : Java Development - Use content assist function and declarations
  30. WebSphere V5.0 : Java Development - Use refactoring features
  31. WebSphere V5.0 : Java Development - Use Outline View and Browsing View
  32. WebSphere V5.0 : Java Development - Create Java project, packages, classes, methods
  33. WebSphere V5.0 : Workbench Basics - Use the Help feature to aid in development activities
  34. WebSphere V5.0 : Workbench Basics - Import to and export from the workbench
  35. WebSphere V5.0 : Workbench Basics - Work with Perspectives
  36. WebSphere V5.0 : Workbench Basics - Set workbench preferences
  37. WebSphere V5.0 : Workbench Basics - Create J2EE projects
 

Comments