 |
|
Deploying Applications Using Enterprise
Manager
Oracle Application Server Tips by Burleson
Consulting |
As already discussed, components are
packaged into archives for deployment onto the application server.
However, a number of files must be updated before the application
server can provide support for a component. Web components are
packaged into WAR files that contain all the files needed to support
that component. These may include HTML pages, Java Server Pages,
servlets, or image files. Enterprise JavaBeans are packaged into JAR
files with all their supporting class files. When deploying groups
of packages together, they are placed in an EAR (Enterprise Archive)
that contains all of the JAR, WAR, and other files needed for that
package. An entire application can be packaged into one EAR archive
that is deployed to the application server.
Deploying an application to Oracle
Application Server 10g requires that a number of support files be
updated. For this reason Oracle recommends that you use Oracle
Enterprise Manager to deploy your application. Alternately, your
developers can deploy components to the application server directly
from JDeveloper. You can also deploy your application using the Java
admin.jar tool. And finally, you can manually deploy your
application and modify the appropriate files, but this is not
recommended. Because this book focuses on administration of the
Application Server and not on J2EE development, we are not going to
discuss the mechanics of packaging a component for deployment. You
should receive the application properly packaged from the
developers.
Since you have Enterprise Manager (if
you are running Application Server 10g), we will discuss using EM to
deploy an application. For the purpose of this exercise, we are
going to deploy an EAR file from the administrator?s computer
(running the browser) to the application server using Enterprise
Manager. The file we are going to deploy is called petstore.ear, and
it was sent to us by the developer ready to deploy. The application
is going to be deployed into the OC4J container called OC4J_Demos,
which was created when we installed the Application Server. Once you
start Enterprise Manager, navigate to the instance where the
application will be deployed. If EM is not running, you need to
start it.
ORACLE_HOME/bin/emctl start em
Figure 4: Enterprise Manager instance status
page
At the top of the status page shown in
Figure 6-4, is a link to J2EE Applications. Selecting this link will
display a list of current applications installed on all OC4J
instances, as shown in Figure 6-5.
Figure 5: Enterprise Manager J2EE
Applications page
Return to the instance status page.
For this exercise, we are going to use the OC4J_Demos container.
Selecting the OC4J_Demos link displays the OC4J Status page, where
you can configure, start, or stop the OC4J container (covered in the
next chapter). It also lists the current EAR files deployed inside
this container. In Figure 6-6, Enterprise Manager lists two deployed
EAR files: FAQApp and transtrace. To deploy the petstore.ear file,
select the Deploy Ear File button located in the Applications
section.
Figure 6: Enterprise Manager?s OC4J Status
page
The Deploy Application Wizard starts
by requesting the location of the EAR file and the application?s
name. Using the Browse button, locate the petstore.ear file. The
application name is petstore. Since this is a new application, it
does not have a parent, so leave the Parent Application combo box
set to Default. Select the Continue button.
Figure 7: Enterprise Manager?s Deploy
Application Wizard
The web component (PetStoreWAR)
contained in the petstore.ear file must be mapped to a URL so that
browsers can access it from OHS. Enter the URL beginning with a /,
such as /petstore. This will map the application to
http://<host>:<port>/petstore as shown in Figure 6-8.
Figure 8: Enterprise Manager?s Deploy
Application: URL Mapping
Select the Next button to continue to
the Resource Reference Mappings page, shown in Figure 6-9. Here you
map a resource reference to an entity such as a data source. To map
to a resource, you must have already deployed that resource to the
container. Selecting Next again will take you to the Review page,
shown in Figure 6-10. Selecting the Deploy button will begin the
process of deploying the EAR file to the container (Figure 6-11).
Figure 9: Enterprise Manager?s Deploy
Application: Resource Reference Mappings page
Figure 10: Enterprise Manager?s Deploy
Application: Review page
Figure 11: Enterprise Manager?s Deploy
Application: Deploy page
Depending on the size of the
application being deployed, the actual deployment process can take
quite a while. If the EAR file contains web components (as this one
does), the wizard will automatically restart OHS after completing
the deployment. Once completed, Enterprise Manager will display the
Confirmation page (Figure 6-12).
Figure 12: Enterprise Manager?s Deploy
Application Wizard Confirmation page
Selecting the OK button will return
you to the OC4J Status page, displaying the new petstore application
in the application section (Figure 6-13). If this new application is
dependent on other components, they must also be deployed in order
for petstore to function.
Figure 13: Enterprise Manager?s OC4J Status
page with our example file deployed
This is an excerpt from "Oracle
10g Application Server Administration Handbook" by Don Burleson
and John Garmany.