Sharing Applications and Modules By Using Java EE Libraries Adding JARs to the Domain lib Directory

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

Java EE libraries provide an easy way to share one or more different types of Java EE modules among multiple Enterprise applications. A Java EE library is a single module or collection of modules that is registered with the Java EE application container upon deployment. For more information, see Chapter 9, Creating Shared Java EE Libraries and Optional Packages.

8.6 Adding JARs to the Domain lib Directory

WebLogic Server includes a lib subdirectory, located in the domain directory, that you can use to add one or more JAR files, so that the JAR file classes are available within a separate system level classloader to all J2EE applications running on WebLogic Server instances in the domain. The JARS in the domain lib directory will not be appended to the system classpath. The classloader that gets created is a child of the system classloader. Any classes that are in JARs in the domain lib directory will only be visible to J2EE applications, such as EAR files. Classes in the system classpath cannot access classes in the domain lib directory. The lib subdirectory is intended for JAR files that change infrequently and are required by all or most applications deployed in the server. For example, you might use the lib directory to store third-party utility classes that are required by all J2EE Understanding WebLogic Server Application Classloading 8-17 deployments in a domain. Third-party utility classes will be made available because the domain lib classloader will be the parent of any J2EE application. The lib directory is not recommended as a general-purpose method for sharing a JARs between one or two applications deployed in a domain, or for sharing JARs that need to be updated periodically. If you update a JAR in the lib directory, you must reboot all servers in the domain in order for applications to realize the change. If you need to share a JAR file or Java EE modules among several applications, use the Java EE libraries feature described in Chapter 9, Creating Shared Java EE Libraries and Optional Packages. To share JARs using the lib directory: 1. Shutdown all servers in the domain. 2. Copy the JAR files to share into a lib subdirectory of the domain directory. For example: mkdir c:\bea\wlserver_10.3\samples\domains\wl_server\lib cp c:\3rdpartyjars\utility.jar c:\bea\wlserver_10.3\samples\domains\wl_server\lib 3. Start the Administration Server and all Managed Servers in the domain. Note: WebLogic Server must have read access to the lib directory during startup. The Administration Server does not automatically copy files in the lib directory to Managed Servers on remote machines. If you have Managed Servers that do not share the same physical domain directory as the Administration Server, you must manually copy JAR files to the domain_namelib directory on the Managed Server machines. 8-18 Developing Applications for Oracle WebLogic Server 9 Creating Shared Java EE Libraries and Optional Packages 9-1 9 Creating Shared Java EE Libraries and Optional Packages The following sections describe how to share components and classes among applications using shared Java EE libraries and optional packages: ■ Section 9.1, Overview of Shared Java EE Libraries and Optional Packages