Testing with an enterprise bean

This article describes how to test your WebSphere Application Server installation by using an enterprise bean and the Increment sample. These instructions assume that you have installed and tested your WebSphere Application Server system. Perform the following steps:

  1. Ensure that you are logged into the host machine with superuser (root) privileges.
  2. Navigate to the directory containing the startupServer.sh script (located by default in the /opt/WebSphere/AppServer/bin directory) by using the cd command, as follows:
    # cd /opt/WebSphere/AppServer/bin
  3. Start the WebSphere Administrative Server by running the script startupServer.sh, as follows:
    # ./startupServer.sh

    Ensure that the server has started successfully by checking the file named tracefile located in the /opt/WebSphere/AppServer/logs directory. Use the tail command to check the file, as follows:

    # tail -f tracefile
    The message ...open for e-business appears in this file when the server has started successfully.

  4. Navigate to the directory containing the adminclient.sh script (located by default in the /opt/WebSphere/AppServer/bin directory) by using the cd command, as follows:
    # cd /opt/WebSphere/AppServer/bin
  5. Start the administrative console by running the script adminclient.sh, as follows:
    # ./adminclient.sh
  6. When the console displays the message Console Ready, administer the application server by doing the following:
    1. When the administrative console opens, a tree view is displayed. Click the plus sign (+) next to the WebSphere Administrative Domain entry to expand the view.
    2. Click the plus sign (+) next to the Nodes entry to expand the view.
    3. Identify the name of your host machine and expand the view of that entry.
    4. Click the plus sign (+) next to the Application Servers entry to expand the view.
    5. Select the Default Server entry and click the Start icon on the toolbar. An information window opens stating that the server has started. Click OK to close this window.

      After the default server is started initially, it will start automatically if it stops or if you restart the machine. Even if the administrative server fails, the application server continues to run.

  7. Ensure that the Web Server is running. If the Web server is not running, start it.
  8. Start a Web browser and specify the following URL:
    http://machine_name/webapp/examples/HitCount
    In this command, machine_name represents the name of the machine on which WebSphere Application Server is running. When the Web page opens, several selection options are displayed.
  9. Under the heading Generate hit count using, click the radio button for the option Enterprise Java Bean.
  10. Under the heading Transaction Type, click the radio button for the option None.
  11. Click Increment.

    If the number of hits is displayed, WebSphere Application Server is operating properly.