Chapter 23. Packaging and deploying Java EE applications 835
23.4 Creating WebSphere-enhanced EAR files
A WebSphere-enhanced EAR file is a regular Java EE EAR file but with additional
configuration information for resources required by Java EE applications. This information is
processed by WebSphere Application Server. Any other application server ignores this
information. Although adding this extra configuration information at packaging time is not
mandatory, it can simplify deployment of Java EE applications to multiple run times if the
environments are similar.
If you plan to provide the configuration of these resources by using the runtime environment
administrative tools, you can skip this section and go directly to 23.5, “Exporting an
application project to an EAR file” on page 845.
When an enhanced EAR is deployed to WebSphere Application Server, the resources
specified in the enhanced EAR are automatically configured at application level scope. When
an enhanced EAR is uninstalled, the resources that are defined at the application level scope
are removed as well. However, resources that are defined at a scope other than application
level are not removed because they might be in use by other applications. Resources that are
created at the application level scope are limited in visibility to only that application.
Table 23-7 shows the resources that are supported by the enhanced EAR and the scope in
which they are created.
Table 23-7 Scope for resources in WebSphere enhanced EAR file
To view the application scoped resources using the administrative console, click
Applications Application Types WebSphere Enterprise Applications
<application>. Select Application scoped resources in the References section. If there are
no application scoped resources, you do not see this option.
23.4.1 Configuring a WebSphere enhanced EAR
You can modify the supplemental information in an enhanced EAR using the WebSphere
Application Server Deployment editor of any of the assembly tools mentioned in 23.1.2,
“Development tools” on page 816. The deployment information is contained in XML files in a
folder called ibmconfig in the EAR file’s META-INF folder.
Resource Scope
JDBC providers Application
Data sources Application
Resource adapters Application
JMS resources Application
Substitution variables Application
Class loader policies Application
Shared libraries Server
JAAS authentication aliases Cell
Virtual hosts Cell
836 WebSphere Application Server V8.5 Administration and Configuration Guide for the Full Profile
In the sample application, the provider is changed to use DB2. To make this change, the
following configuration items are added to the deployment file:
JAAS authentication alias
JDBC provider for DB2
Data source for DB2 database
A new virtual host for a domain called www.itsobank.ibm.com is also added.
To access the enhanced EAR deployment options, right-click the RAD8EJBWebEAR project,
and select Java EE. Click Open WebSphere Application Server Deployment to open the
editor, as shown in Figure 23-12.
Figure 23-12 WebSphere enhanced EAR editor
23.4.2 Configuring application options
The Application section shown in Figure 23-13 contains the class loader policies and class
loader mode configured for each of the containing modules. ITSO Bank runs with the default
policies and modes. You do not need to change them. The
Auto start feature is new with
WebSphere Application Server V8.5. When set to Yes, the application starts at the application
server start.
Figure 23-13 Configuring class loader mode and class loader policies
To configure the JAAS authentication alias required to access the application database:
1. Expand the Authentication section.
2. Click Add.
Chapter 23. Packaging and deploying Java EE applications 837
3. In the window that opens, enter the following information:
An alias of itsobank
A user ID with access to the ITSOBANK database (db2inst1 in our case)
The password for the user ID
An optional description of ITSO Bank
4. Click OK. Figure 23-14 shows the results.
Figure 23-14 Configuring JAAS authentication alias for ITSO Bank
23.4.3 Configuring the JDBC provider and data source for DB2
To configure JDBC providers, expand the Data Sources section. Before you add the DB2
provider, delete the pre-configured Derby JDBC Provider (XA) provider by selecting it and by
clicking Remove.
To configure the DB2 JDBC provider:
1. Click Add next to the JDBC provider list.
2. In the window that opens, select the following options, as shown in Figure 23-15 on
page 838:
IBM DB2 as the Database type.
DB2 Universal JDBC Driver Provider as the JDBC provider type.
Click Next.
838 WebSphere Application Server V8.5 Administration and Configuration Guide for the Full Profile
Figure 23-15 Creating a DB2 JDBC provider - Selecting the JDBC provider type
3. In the next window, enter a name for the JDBC provider (for administration purposes only),
and leave the other properties as the default values. See Figure 23-16 on page 839. Click
Finish.

Get WebSphere Application Server V8.5 Administration and Configuration Guide for the Full Profile now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.