This feature is similar to the APP-INF/lib feature supported in WebLogic Server. These libraries may reference other libraries, either bundled with the application or installed separately. jar extension must be made available to all components packaged in the EAR file, including application clients. All files in this directory (but not in subdirectories) with a. An empty library-directory element may be used to specify that there is no library directory. If a library-directory element isn't specified, or if the EAR file does not contain a deployment descriptor, the directory named lib is used. The library-directory element of the EAR file's deployment descriptor contains the name of this directory. An EAR file may contain a directory that contains libraries packaged in JAR files. Libraries can be bundled with an application or may be installed separately for use by any application. The Java EE platform provides several mechanisms for applications to use optional packages and shared libraries. (With Java EE libraries, only a complete Enterprise application can reference the library). Optional packages, rather than Java EE libraries, are used in this case, because the individual Web application modules must reference the shared JAR file. Java EE libraries can be referenced only from a valid Enterprise application.įor example, third-party Web application Framework classes needed by multiple Web applications can be packaged and deployed in a single JAR file, and referenced by multiple Web application modules in the domain.
Optional packages differ from Java EE libraries because optional packages can be referenced from any Java EE module (EAR, JAR, WAR, or RAR archive) or exploded archive directory. If optional package references are found they are added to the wlcompile and appc tasks in the generated build.xml file. Optional packages are also supported as Java EE shared libraries in weblogic.BuildXMLGen, whereby all manifests of an application and its modules are scanned to look for optional package references. After registering the package, you can deploy Java EE modules that reference the package in their manifest files. As with Java EE libraries, optional packages must first be registered with WebLogic Server by deploying the associated JAR file as an optional package. Optional packages provide similar functionality to Java EE libraries, allowing you to easily share a single JAR file among multiple applications. WebLogic Server supports optional packages as described in the Java EE 5.0 Specification, Section 8.2 Optional Package Support, with versioning described in Optional Package Versioning (see ). See Web Application Shared Java EE Library Information for details. The functionality is very similar to application libraries, although the method of referencing them is slightly different. You can also create libraries that can be referenced only by another Web application. In general, this topic discusses shared Java EE libraries that can be referenced only by Enterprise applications. The library classes are added to the classpath of the referencing application, and the referencing application's deployment descriptors are merged (in memory) with those of the modules that make up the shared Java EE library. Each referencing application receives a reference to the required library on deployment, and can use the modules that make up the library as if they were packaged as part of the referencing application itself. However, for development purposes, you may choose to deploy shared Java EE libraries as exploded archive directories to facilitate repeated updates and redeployments.Īfter the shared Java EE library has been registered, you can deploy Enterprise applications that reference the library. Oracle recommends that you package a shared Java EE library into its appropriate archive file (EAR, JAR, or WAR). Multiple Web application modules package in an Enterprise application Multiple EJB modules packaged in an Enterprise application A shared Java EE library can be any of the following: A shared Java EE library is a single module or collection of modules that is registered with the Java EE application container upon deployment. The shared Java EE library feature in WebLogic Server provides an easy way to share one or more different types of Java EE modules among multiple Enterprise applications. Overview of Shared Java EE Libraries and Optional Packages