Understanding WebLogic Server Application Classloading 8-15
hierarchy. Be aware that using this feature is subtly different from using the manifest Class-Path described in the following section. With this feature, class definitions are
shared across the application. With manifest Class-Path, the classpath of the referencing module is simply extended, which means that separate copies of the
classes exist for each module.
8.3.3 Manifest Class-Path
The Java EE specification provides the manifest Class-Path entry as a means for a module to specify that it requires an auxiliary JAR of classes. You only need to use this
manifest Class-Path entry if you have additional supporting JAR files as part of your EJB JAR or WAR file. In such cases, when you create the JAR or WAR file, you
must include a manifest file with a Class-Path element that references the required JAR files.
The following is a simple manifest file that references a utility.jar file: Manifest-Version: 1.0 [CRLF]
Class-Path: utility.jar [CRLF] In the first line of the manifest file, you must always include the Manifest-Version
attribute, followed by a new line CR | LF |CRLF and then the Class-Path attribute. More information about the manifest format can be found at:
http:java.sun.comj2se1.4docsguidejarjar.htmlJAR The manifest Class-Path entries refer to other archives relative to the current archive
in which these entries are defined. This structure allows multiple WAR files and EJB JAR files to share a common library JAR. For example, if a WAR file contains a
manifest entry of y.jars, this entry should be next to the WAR file not within it as follows:
directoryx.war directoryy.jars
The manifest file itself should be located in the archive at META-INFMANIFEST.MF. For more information, see
http:download-llnw.oracle.comjavasetutorialdeploymentjarm anifestindex.html
.
8.4 Using the Classloader Analysis Tool CAT
CAT is a Web-based class analysis tool which simplifies filtering classloader configuration and aids you in analyzing classloading issues, such as detecting
conflicts, debugging application classpaths and class conflicts, and proposes solutions to help you resolve them.
CAT is a stand-alone Web application, distributed as a single WAR file, wls-cat.war, exposing its features through a Web-based front end. CAT is deployed as an internal
on-demand application only in development mode. Deployment happens upon first access. If the server is running in production mode, it is not deployed automatically.
You can deploy it in production mode; there are no limitations on its use, but you must deploy it manually, just like any other Web application. The CAT Web application is
located at WL_HOMEserverlibwls-cat.war. You can deploy it to any WebLogic Server version 10.3.x and later.
To begin using CAT:
8-16 Developing Applications for Oracle WebLogic Server
■
In the WebLogic Server Administration Console, select Deployments app_name Testing and then select the Classloader Analysis Tool link. Enter your Console
login credentials.
■
Or, open your browser to http:wls-host:portwls-cat and then enter your Console login credentials.
CAT has a simple Web GUI which displays all your currently running applications and modules. In the left-side navigation pane, you select the application or module that
you want to analyze; a brief description of it is shown in the right-side pane. You use the right-side pane to perform actions and analyses on the selected application or
module. CAT lets you:
■
Analyze classloading conflicts
■
View the system and application classloaders
■
Generate reports CAT analyzes classes loaded by the system classpath classloader and the WebLogic
Server main application classloaders, defined here as the filtering, application, and module classloaders. You can perform analysis at the class, package, or JAR level. The
results for each action you select can be shown in either a basic view or a detailed view.
Here are some of the tasks which you can perform using CAT:
■
Display basic information about applications and modules
■
Analyze classloading conflicts
■
Review proposed solutions
■
Get suggestions for configuring filtering classloaders
■
Display the classloader hierarchy and the entire classpath for each classloader
■
Search for a class or a resource on a classloader
8.5 Sharing Applications and Modules By Using Java EE Libraries