Understanding Deployment Behavior for Shared Libraries

Deploying Applications and Modules with weblogic.Deployer 6-17

6.11 Deploying Shared Java EE Libraries and Dependent Applications

Java EE library support in WebLogic Server provides an easy way to share one or more Java EE modules or JAR files among multiple Enterprise applications. A Java EE library is a standalone Java EE module, multiple Java EE modules packaged in an Enterprise application EAR, or a plain JAR file that is registered with the Java EE application container upon deployment. After a Java EE library has been registered, you can deploy Enterprise applications that reference the library. Each referencing application receives a copy of the shared Java EE library modules on deployment, and can use those modules as if they were packaged as part of the application itself. ■ Section 6.11.1, Understanding Deployment Behavior for Shared Libraries ■ Section 6.11.2, Registering Libraries with WebLogic Server ■ Section 6.11.3, Specifying Library Versions at Deployment ■ Section 6.11.4, Deploying Applications That Reference Libraries

6.11.1 Understanding Deployment Behavior for Shared Libraries

WebLogic Server supports shared Java EE libraries by merging the shared files with a referencing application when the referencing application is deployed. You first register a Java EE library or optional package with one or more WebLogic Server instances or clusters by deploying the library and indicating that the deployment is a library see Section 6.11.2, Registering Libraries with WebLogic Server . Deploying a library or package does not activate the deployment on target servers. Instead, WebLogic Server distributes the deployment files to target servers if nostage deployment mode is used and records the location of the deployment files, the deployment name, and any version string information for the library or package. When an application that references a shared library or package is deployed, WebLogic Server checks the names and version string requirements against the libraries registered with the server. If an exact match for a library or package name is not found, or if the version requirements are not met, the application deployment fails. If WebLogic Server finds a name and version string match for all of the libraries referenced in the application, the server adds the libraries classes to the classpath of the referencing application and merges deployment descriptors from both the application and libraries in memory. The resulting deployed application appears as if the referenced libraries were bundled with the application itself. The contents of a Java EE library are loaded into classloaders in the same manner as any other Java EE modules in an Enterprise application. For example, EJB modules are loaded as part of the referencing applications classloader, while Web application modules are loaded in classloaders beneath the application classloader. If a shared Java EE library consists of an EAR, any classes stored in the EARs APP-INFlib or APP-INFclasses subdirectory are also available to the referencing application. You cannot undeploy any Java EE libraries or optional packages that are referenced by a currently deployed application. If you need to undeploy a shared library or package, you must first undeploy all applications that use the shared files. For regular application maintenance, you should deploy a new version of a shared library or Note: Oracle documentation and WebLogic Server utilities use the term library to refer to both Java EE libraries and optional packages. Optional packages are called out only when necessary. 6-18 Deploying Applications to Oracle WebLogic Server package and redeploy referencing applications to use the newer version of the shared files. See Editing Manifest Entries for Shared Libraries in Developing Applications for Oracle WebLogic Server for more information.

6.11.2 Registering Libraries with WebLogic Server