6.7.2: Application deployment tutorial
During this tutorial, you will deploy the J2EE application that you assembled
during the Application assembly tutorial.
Deployment involves configuring the server and supporting resources (you will use
the existing default server), and installing the application. Installing the
application means configuring the settings pertaining to this application in
the server runtime. The runtime settings include choices such as whether to
automatically load servlets, or to precompile JSP files.
Prerequisites
Before performing this tutorial, either:
Overview of steps (requires 15 to 30 minutes)
- Obtain the tutorial application
- Start the administrative server
- Open the administrative console
- Prepare the application server and needed resources
- Install the application
- Regenerate the Web server plug-in
- Modify Module Visibility, stop the application server, and start it again
Paths through the tutorial
- Quick path: If your objective is
to practice these steps as quickly as possible, skip the
explanations marked with the
graphic.
- Maximum learning path: If your objective is to understand and explore the
product capabilities, read the
notes and browse the links
they provide to additional documentation.
If you completed the Application assembly tutorial, you simply need
to know the location of the simpleSession.ear file that you assembled, including generating
code for deployment. It should be
located in the directory:
product_installation_root/temp/tutorial/assembly/Deployed_simpleSession.ear
If you did not perform the assembly tutorial, and thus plan to use the
already assembled .ear file:
- Create a directory named "tutorial" under the path:
product_installation_root/temp
- Click here to access the .zip file containing the tutorial application components.
- Save the .zip file to
product_installation_root/temp/tutorial
- Use your favorite .zip or .jar utility to extract the tutorial.zip content into
the tutorial directory.
- Copy the shortcut_Deployed_simpleSession.ear file. Name the copy Deployed_simpleSession.ear.
First, start the product administrative server.
- Open a system command prompt.
- Change directory to:
product_installation_root/bin
- Enter: adminserver
Leave the command window open, as you will use it again later
to start the server.
Now it is time to deploy (install) the application in the server runtime. To do so,
you will use the administrative console.
- Open a system command prompt.
- Change directory to:
product_installation_root/bin
- Enter: adminclient
For more information about variations on starting and
stopping the administrative server, see see the corresponding InfoCenter
article.
For the purposes of the tutorial, use the WebSphere runtime environment "as is." The
default application server and other resources are everything you need to deploy the
simpleSession application.
- In the console tree view, right-click
WebSphere Administrative Domain -> Enterprise Applications.
- From the resulting menu, click Install Enterprise Application to launch the Install
Enterprise Application wizard.
- On the Specifying the Application or Module panel:
- Ensure that the Browse for file on node field is set to your current node.
- Ensure Install Application is selected.
- Click Browse, next to the Path field. Browse
for the Deployed_simpleSession.ear file and select it.
Verify that its name is displayed in the Path field now.
- Specify SimpleSessionApp as the Application name.

- Click Next.
- On the Mapping Users to Roles panel, click Next.
- On the Mapping EJB RunAs Roles to Users panel, click Next.
- On the Binding Enterprise Beans to JNDI Names panel, verify that
the JNDI Name is set to gs/hello, and then click Next.
- On the Mapping EJB References to Enterprise Beans panel, verify that
the JNDI Name is set to gs/hello, and then click Next.
- On the Mapping Resource References to Resources panel, click Next.
- On the Specifying the Default Datasources for EJB Modules panel, click Next.
- On the Specifying Data Sources for Individual CMP Beans panel, click Next.
- On the Selecting Virtual Hosts for Web Modules panel, ensure that the Virtual Host
is set to default_host, then click Next.
- On the Selecting Application Server panel, ensure that the EJB11 and SimpleSessionWar
modules are going to reside on Application Server "Default Server," then click Next.
- Click Finish on the Completing the Application Installation Wizard panel.

- When prompted whether to regenerate code, click No.

- Look for the message confirming successful installation of the application. It might be a minute
before it is displayed.
You can now view the SimpleSessionApp in the console tree view.
- In the console tree view, right-click WebSphere Administrative Domain -> Nodes -> your_host_name.
- From the resulting menu, select Regen Webserver Plugin.
- In the area at the bottom of the console, look for the Event Message saying that the
Plugin regeneration has been completed. It might take a moment before it is displayed.
- In the console tree view, click WebSphere Administrative Domain -> Nodes -> your_host_name
-> Application Servers -> Default Server.
- Change the Module Visibility setting of the Default Server to "Compatibility"
and click Apply.
- Now right-click the Default Server.
- From the resulting menu, click Stop.
- Look for the message that the server was stopped successfully.

- Now right-click Default Server again and click Start on the resulting menu.
- Again, wait for the confirmation message.

Because adding a new application requires
a change to the server configuration file, the server must be stopped and started
again to pick up the change. However, there are some types of changes you can
make to an installed application that do not require stopping the server and
starting it again. See the dynamic reloading and hot
deployment documentation for more information.
What's next?
Now that you have your application deployed, it is time to verify that users
will be able to access it, using either a Web client or Java client. The next
steps are described in the Application testing
tutorial.