• Non ci sono risultati.

Basic Deployment

Nel documento Oracle9 Application Server (pagine 187-194)

Your J2EE application can contain the following modules:

Web applications

The Web applications module (WAR files) includes servlets and JSP pages.

EJB applications

The EJB applications module (EJB JAR files) includes Enterprise JavaBeans (EJBs).

Client application contained within a JAR file

Archive the JAR and WAR files that belong to an enterprise Java application into an EAR file for deployment to OC4J. The J2EE specifications define the layout for an EAR file.

The internal layout of an EAR file should be as follows:

Figure 8–2 Archive Directory Format

Archive these files using the JAR command in the<appname> directory, as follows:

% jar cvfM <appname>.EAR .

Note that theapplication.xml file acts as a manifest file.

Note: You can also deploy simple applications withdcmctl, the DCM command-line utility. SeeAppendix F, "DCM Command-Line Utility (dcmctl)" for more information.

<appname>/

META-INF/

application.xml EJB JAR file

WEB WAR file Client JAR file

Deploying J2EE Applications

To deploy a J2EE application packaged within an EAR file, click Deploy Ear File in the Applications section of the OC4J Home Page.

To deploy a J2EE Web application packaged within a WAR file, click Deploy WAR File in the Applications section of the OC4J Home Page.

Both of these buttons start an eight-step application deployment wizard that guides you through deploying an application. When you deploy an application within a WAR file, theapplication.xml file is created for the Web application. When you deploy an application within an EAR file, you must create theapplication.xml file within the EAR file. Thus, deploying a WAR file is an easier method for deploying a Web application.

Figure 8–3 shows the eight steps required for application deployment:

Figure 8–3 Deployment Wizard Steps

Introduction

The first page is an introduction to these steps. It reminds you to provide an EAR file with any OC4J-specific XML configuration files, if necessary. It also outlines some of the other steps in the deployment process.

Click Next to go to the next step in the wizard deployment process.

Select Application

Figure 8–4 shows the second page, which enables you to browse your system for the EAR file to be deployed and provide a name to be identified with this

application. The application name is user-created and will be the identifier for the application in the OC4J Home Page.

Note: You must still provide configuration for J2EE services, such as data source and security configuration.

Deploying J2EE Applications

Figure 8–4 Designate Ear File

When the application is deployed, the following occurs:

1. The EAR file is copied to the/applications directory.

2. A new entry is created inserver.xml for the application, as follows:

<application name=<app_name> path=<path_EARfile> auto-start="true"

/>

where

Thename variable is the name of the application you provided.

Thepath indicates the directory and filename where the EAR file is deployed.

Theauto-start variable indicates whether this application should be automatically restarted each time OC4J is restarted.

For a description of the elements inserver.xml, see Oracle9iAS Containers for J2EE User’s Guide.

Click Next to go to the next step in the wizard deployment process.

Provide The URL Mappings For All Web Modules

Map any Web modules in your application to a specific URL for its servlet context.

All OC4J servlet contexts must be prefixed with a slash "/". When you try to access any Web applications, you provide the host, port, and Web context.

For all Web modules, your URL mapping for the module includes the URL you bind in this screen. Thus, for the URLhttp://host:port/url_name, provide /url_name in the URL mapping screen of the wizard.

Deploying J2EE Applications

Figure 8–5 URL Mappings for Web Modules

Click Next to go to the next step in the wizard deployment process.

Provide Any Resource Reference Mappings

Map any resource references in your application, such as data sources or mail queues, to physical entities currently present on the OC4J container. Note that if you need a specific resource, you must have already added it to the OC4J container before you deploy your application in order for you to match them in this step.

For most applications, the resource reference you must designate is the data source JNDI name. This screen does not configure the data source information, it only designates an already configured data source or a data source that you will be configuring later. Designate the JNDI location name of the data source that the application uses.

Figure 8–6 Resource Reference Mappings

Deploying J2EE Applications

Click Next to go to the next step in the wizard deployment process.

Specify Any User Manager

You can specify what User Manager to use for security. For complete security, we recommend that you choose the JAZN XML User Manager.

Figure 8–7 User Manager Choices

AsFigure 8–7 demonstrates, you must already have your User Manager set up and configured. Most of the entries require an XML file that designates the security roles, users, and groups for your security mappings.

The User Manager types are as follows:

JAZN XML User Manager—This is the recommended User Manager. It requires a default realm and ajazn-data.xml file.

XML User Manager—This is not the most secure option. It requires a principal.xml file.

JAZN LDAP User Manager—This requires a default realm and an LDAP location.

Deploying J2EE Applications

Custom User Manager—This User Manager must be programmed; provide the class name in this field.

For more information on security and User Managers, see both the Oracle9iAS Containers for J2EE User’s Guide and the Security chapters in the Oracle9iAS Containers for J2EE Services Guide.

Provide Any Security Role Mappings

Map any security roles defined in your application to existing users and groups. If you have defined a security role within your application, you can map this role to a security group or role. You do not define security groups and users in this screen.

Users and groups are obtained from your user manager.

Figure 8–8 Security Role Mappings

Click Next to go to the next step in the wizard deployment process.

Publish Web Services

Publish any Web services defined in your application. This feature requires the UDDI registry. Web services are not installed with a core install.

If you have defined any Web services, they are displayed on the Publish Web Services Page.

Deploying J2EE Applications

Figure 8–9 Publish Web Services

If you want to publish these Web services, then click Publish. This leads you through the process of publishing your Web services. When finished, it brings you back to this screen.

Click Next to go to the next step in the wizard deployment process.

Summary of Deployment

At this point, you will receive a summary of your application deployment modules and configuration, as shown inFigure 8–10.

Figure 8–10 Deploy Application Summary

Nel documento Oracle9 Application Server (pagine 187-194)

Documenti correlati