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)

  1. Obtain the tutorial application
  2. Start the administrative server
  3. Open the administrative console
  4. Prepare the application server and needed resources
  5. Install the application
  6. Regenerate the Web server plug-in
  7. Modify Module Visibility, stop the application server, and start it again
Paths through the tutorial

Obtain the tutorial application

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:

  1. Create a directory named "tutorial" under the path:
    product_installation_root/temp
    
  2. Click here to access the .zip file containing the tutorial application components.
  3. Save the .zip file to
    product_installation_root/temp/tutorial
    
  4. Use your favorite .zip or .jar utility to extract the tutorial.zip content into the tutorial directory.
  5. Copy the shortcut_Deployed_simpleSession.ear file. Name the copy Deployed_simpleSession.ear.

Start the administrative server

First, start the product administrative server.

  1. Open a system command prompt.
  2. Change directory to:
    product_installation_root/bin
    
  3. Enter: adminserver

Leave the command window open, as you will use it again later to start the server.

Start the server

Open the administrative console

Now it is time to deploy (install) the application in the server runtime. To do so, you will use the administrative console.

  1. Open a system command prompt.
  2. Change directory to:
    product_installation_root/bin
    
  3. Enter: adminclient

Starting the console

  For more information about variations on starting and stopping the administrative server, see see the corresponding InfoCenter article.

Console when first opened

Prepare the application server and needed resources

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.

Install the application

  1. In the console tree view, right-click WebSphere Administrative Domain -> Enterprise Applications.
  2. From the resulting menu, click Install Enterprise Application to launch the Install Enterprise Application wizard.
  3. On the Specifying the Application or Module panel:

    1. Ensure that the Browse for file on node field is set to your current node.
    2. Ensure Install Application is selected.
    3. Click Browse, next to the Path field. Browse for the Deployed_simpleSession.ear file and select it.

      Selecting the .ear file

      Verify that its name is displayed in the Path field now.

    4. Specify SimpleSessionApp as the Application name.

      Specifying the application or module

    5. Click Next.
  4. On the Mapping Users to Roles panel, click Next.
  5. On the Mapping EJB RunAs Roles to Users panel, click Next.
  6. On the Binding Enterprise Beans to JNDI Names panel, verify that the JNDI Name is set to gs/hello, and then click Next.
  7. On the Mapping EJB References to Enterprise Beans panel, verify that the JNDI Name is set to gs/hello, and then click Next.
  8. On the Mapping Resource References to Resources panel, click Next.
  9. On the Specifying the Default Datasources for EJB Modules panel, click Next.
  10. On the Specifying Data Sources for Individual CMP Beans panel, click Next.
  11. On the Selecting Virtual Hosts for Web Modules panel, ensure that the Virtual Host is set to default_host, then click Next.

    Selecting virtual hosts for Web modules

  12. 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.
  13. Click Finish on the Completing the Application Installation Wizard panel.

    Completing the wizard

  14. When prompted whether to regenerate code, click No.

    Prompt about regenerating code

  15. 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.

Application now in tree view

Regenerating the plug-in configuration

  1. In the console tree view, right-click WebSphere Administrative Domain -> Nodes -> your_host_name.
  2. From the resulting menu, select Regen Webserver Plugin.
  3. 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.
Modifying Module Visibility, stopping the application server, and starting it again

  1. In the console tree view, click WebSphere Administrative Domain -> Nodes -> your_host_name -> Application Servers -> Default Server.
  2. Change the Module Visibility setting of the Default Server to "Compatibility" and click Apply. Changing default server module visibility to compatibility mode
  3. Now right-click the Default Server.
  4. From the resulting menu, click Stop.
  5. Look for the message that the server was stopped successfully.

    Server stopped

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

    Server started

  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.