WebSphere Application Server 버전 3.0 릴리즈 노트



Installing WebSphere Application
Server 3.02 Advanced Edition for
Windows NT...
WebSphere Application Server 버전 3.0 릴리즈 노트


Configuring                     an                  Enterprise               ...
WebSphere Application Server 버전 3.0 릴리즈 노트


If your system already holds WebSphere Application Server and the correct lev...
WebSphere Application Server 버전 3.0 릴리즈 노트




    2. Select Yes, select Next, read the license agreement, and accept it.
...
WebSphere Application Server 버전 3.0 릴리즈 노트




    5. Select Yes to create the directory. Then select Next.
    6. Select ...
WebSphere Application Server 버전 3.0 릴리즈 노트


        password, do it using the Windows NT User Manager. Note the comments ...
WebSphere Application Server 버전 3.0 릴리즈 노트


        If you downloaded DB2 UDB, unzip the DB2 zip file to a temporary dire...
WebSphere Application Server 버전 3.0 릴리즈 노트


from the product Web site. VisualAge for Java Version 3.0 requires fixpack 11...
WebSphere Application Server 버전 3.0 릴리즈 노트


If you receive an error message stating that the database was not created, go...
WebSphere Application Server 버전 3.0 릴리즈 노트




    4. Select Configure server.
    5. When prompted, enter the username an...
WebSphere Application Server 버전 3.0 릴리즈 노트


        When you enter these you should see the configuration page for the We...
WebSphere Application Server 버전 3.0 릴리즈 노트


    1. If IBM HTTP Server or another Web server on your system is running, st...
WebSphere Application Server 버전 3.0 릴리즈 노트

            o   To re-install files, do not place a check mark in the Update i...
WebSphere Application Server 버전 3.0 릴리즈 노트


                If you are installing from the downloaded file, you will now ...
WebSphere Application Server 버전 3.0 릴리즈 노트


                product                                     CD.)




    9. C...
WebSphere Application Server 버전 3.0 릴리즈 노트


        If you have other JDKs installed, make sure you select the IBM JDK, a...
WebSphere Application Server 버전 3.0 릴리즈 노트


        Password specified when installing DB2 UDB. Then click Next.




    ...
WebSphere Application Server 버전 3.0 릴리즈 노트




    14. Click OK, and it will finish updating the files and installing.


 ...
WebSphere Application Server 버전 3.0 릴리즈 노트


    15. Click Finish, and choose to restart.



Finishing prerequisite config...
WebSphere Application Server 버전 3.0 릴리즈 노트


        Processor.
    2. Enter CREATE DATABASE WAS
    3. Wait a minute to a...
WebSphere Application Server 버전 3.0 릴리즈 노트


        If the server is slow to start or does not start successfully, look a...
WebSphere Application Server 버전 3.0 릴리즈 노트




    5. Wait until the little icon in the bottom left corner stops rotating....
WebSphere Application Server 버전 3.0 릴리즈 노트




            3. If the Current State is Stopped, click the green Start butto...
WebSphere Application Server 버전 3.0 릴리즈 노트


                administrative server will automatically restart it. Even if ...
WebSphere Application Server 버전 3.0 릴리즈 노트


and can be located in the Programs -> IBM WebSphere -> Application Server
V3....
WebSphere Application Server 버전 3.0 릴리즈 노트


To configure a DataSource:

    1. Go       to    the    Types    tab,   righ...
WebSphere Application Server 버전 3.0 릴리즈 노트




    4. Right-click on DataSources and select Create. In the Create a DataSo...
WebSphere Application Server 버전 3.0 릴리즈 노트


    5. Click on the Advanced tab. You will see the connection pool parameters...
WebSphere Application Server 버전 3.0 릴리즈 노트




        If you don't, try refreshing the view. Select WebSphere Admin Domai...
WebSphere Application Server 버전 3.0 릴리즈 노트


        Create -> EnterpriseBean.


        Note that the right-click behavio...
WebSphere Application Server 버전 3.0 릴리즈 노트


        Select Increment.jar and double-click on it. You should see "inside" ...
WebSphere Application Server 버전 3.0 릴리즈 노트




        The Database Access field (greyed out) is set to Shared, which is e...
WebSphere Application Server 버전 3.0 릴리즈 노트


        select the DataSource tab. Click Change and, in the Datasource dialog...
WebSphere Application Server 버전 3.0 릴리즈 노트


        is issued, WebSphere Application Server puts a shared lock on the dat...
WebSphere Application Server 버전 3.0 릴리즈 노트




    4. Click    Visit,    and    the    number   of    visits   information...
WebSphere Application Server 버전 3.0 릴리즈 노트



Examining the database

To see what is going on in the database, start up th...
WebSphere Application Server 버전 3.0 릴리즈 노트


WebSphere Application Server "disconnected", you must still always be able to...
WebSphere Application Server 버전 3.0 릴리즈 노트


the top of the TCP/IP Protocol list as shown below.




Save the changes and ...
Upcoming SlideShare
Loading in …5
×

Websphere Application server V3.02 Adv Install.doc.doc.doc

771 views
706 views

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
771
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
37
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Websphere Application server V3.02 Adv Install.doc.doc.doc

  1. 1. WebSphere Application Server 버전 3.0 릴리즈 노트 Installing WebSphere Application Server 3.02 Advanced Edition for Windows NT using DB2 and IBM HTTP Server This guide describes in simple terms how to install a single configuration of WebSphere Application Server Advanced Edition that uses-- • Windows NT • IBM HTTP Server • DB2 UDB • A single node This guide covers installing from the WebSphere Application Server CD as well as upgrading to Version 3.02 by running an executable downloaded from the product Web site at http://www.ibm.com/software/webservers/appserv/. This guide does not describe how to migrate your files used for a previous version of WebSphere Application Server. For information on migrating files and for detailed information about the installation process, see the WebSphere Application Server Version 3.02 Advanced Edition Getting Started manual, which is accessible from the product Web site. Contents Prerequisites Deciding which steps to follow Installing IBM JDK n1.1.7p build level 0823 Installing IBM HTTP Server 1.3.6 Installing DB2 Universal Database (UDB) Testing installation of prerequisites Installing WebSphere Application Server Testing your installation 1 / 38
  2. 2. WebSphere Application Server 버전 3.0 릴리즈 노트 Configuring an Enterprise Bean Setting up TCP/IP for standalone operations Prerequisites Hardware • A Pentium II or comparable processor or later • Support for a communications adapter • 75 MB of free disk space for installation; plus 20 MB for installing IBM HTTP Server; plus 150 MB for installing DB2 UDB • 256 MB of memory (512 recommended) Operating system • Microsoft Windows NT Server Version 4.0 with Service Pack (SP) 4 Software • IBM JDK n1.1.7p for Windows NT, build level 0823 • IBM HTTP Server Version 1.3.6 • DB2 UDB 6.1 with fixpack 2, or DB2 UDB 5.2 with fixpack 10 or 11. If you already have DB2 UDB 5.2 installed with an earlier fixpack, you can install a fixpack over it. If you are using VisualAge for Java 3.0 and DB2 UDB 5.2, you must use fixpack 11. • WebSphere Application Server 3.02 Advanced Edition • A Web browser that supports HTML 4 and Cascading Style Sheets (such as Netscape Navigator 4.07 or Microsoft Internet Explorer 4.01 or higher) You may also need a text editor to edit files and a ZIP tool to unpack files. Deciding which steps to follow 2 / 38
  3. 3. WebSphere Application Server 버전 3.0 릴리즈 노트 If your system already holds WebSphere Application Server and the correct levels of IBM JDK, IBM HTTP Server and DB2 UDB, proceed directly to "Installing WebSphere Application Server" and opt to upgrade your installation. If your system does not already hold WebSphere Application Server, IBM JDK, IBM HTTP Server, and DB2 UDB, obtain the product CD for WebSphere Application Server or download the components listed in "Software" above from the Web. Then, do either of the following: • Install any needed components in the following order: 1. Install IBM JDK n1.1.7p for Windows NT 2. Install IBM HTTP Server Version 1.3.6 3. Install DB2 UDB 6.1 with fixpack 2, or DB2 UDB 5.2 with fixpack 10 or 11 4. Install WebSphere Application Server 3.02 Advanced Edition This is the recommended approach because it allows you to ensure that the prerequisites install correctly before attempting to install WebSphere Application Server. • Proceed directly to "Installing WebSphere Application Server" and instruct the installation program to install the IBM JDK, IBM HTTP Server, and DB2 UDB products for you along with WebSphere Application Server. If your system is not connected to the network, also complete the steps in "Setting up TCP/IP for standalone operations". Installing IBM JDK n1.1.7p build level 0823 Attention: Sun JDK 1.2 causes unexpected results if you install it before installing WebSphere Application Server 3.02 and IBM JDK 1.1.7. To prevent these results, uninstall Sun JDK 1.2 before installing WebSphere Application Server. To install IBM JDK n1.1.7p, which you can obtain from an IBM Web site, do the following: 1. Run the file ibm-jdk-n117p-win32-x86.exe. 3 / 38
  4. 4. WebSphere Application Server 버전 3.0 릴리즈 노트 2. Select Yes, select Next, read the license agreement, and accept it. 3. Leave the default selections and then select Next twice. 4. Select Finish. Installing IBM HTTP Server 1.3.6 To install IBM HTTP Server, which you can obtain from an IBM Web site, do the following: 1. If you have the product CD, run httpdSetup.exe. If you have the downloaded file, run the program HTTPServer_ex.exe. 2. Select the language and click OK. 3. Click Next, read the license agreement, and accept it. 4. Select the installation directory. The following example uses C:http. 4 / 38
  5. 5. WebSphere Application Server 버전 3.0 릴리즈 노트 5. Select Yes to create the directory. Then select Next. 6. Select the Typical installation stream, click Next and then Next to accept the Program folder. The Information for Service Setup window displays: For the user ID and password, consider using a single Windows NT user ID and password for all of the WebSphere and support software packages--DB2, HTTP and WebSphere. Also consider using a user ID which has administrative rights, although this would not be recommended for a production system. Fill in the user ID and password here. If you need to create a new user ID and 5 / 38
  6. 6. WebSphere Application Server 버전 3.0 릴리즈 노트 password, do it using the Windows NT User Manager. Note the comments in the README file; if this machine is a Domain Controller you need to perform an additional step as described in the README file. 7. Click Install, opt not to restart your computer, and finish the install package. 8. Configure the HTTP Admin server password: 1. Go to a command prompt for the c:http directory, and enter: htpasswd -m confadmin.passwd <userid> 2. Type a password, and confirm it. 9. Configure the ServerName of the Web server at this point. (Or, using the Administration console of HTTP Server, configure the Web server at a later time.) 1. Using a text editor such as Notepad, Editpad or WordPad, edit the file c:httpconfhttpd.conf. 2. Go to the line #ServerName new.host.name. Remove the # and replace new.host.name with the domain name of your machine. For example, insert smith.ibm.com. If you don't know your host name, enter hostname at a command prompt. 3. Save the file. If you need to install DB2 UDB, don't reboot yet. If you have already installed DB2 UDB, reboot your system and proceed to "Testing installation of prerequisites." Installing DB2 Universal Database (UDB) If you already have installed DB2 UDB Version 6.1 with fixpack 2 (or fixpack 1a if fixpack 2 is not available) or DB2 UDB Version 5.2 with fixpack 11 (or fixpack 10), then proceed to "Testing installation of prerequisites" or "Installing WebSphere Application Server". Installing the base product 1. If you have the WebSphere Application Server CD, run db2inst.exe in the install subdirectory for the appropriate language. For example, for English look in the ntdb2eninstall subdirectory. 6 / 38
  7. 7. WebSphere Application Server 버전 3.0 릴리즈 노트 If you downloaded DB2 UDB, unzip the DB2 zip file to a temporary directory using an option that recreates the directory structure. Then, run the setup.exe file from the directory. 2. Select Next, choose the Workgroup Edition, and then select Next. 3. Put a check mark beside the Typical installation, keep the default installation directory (C:SQLLIB), and click Next. 4. Overwrite the default Username and Password with the same user ID you specified previously (if you installed IBM HTTP Server). This will make it the DB2 administration ID as well. 5. Select Next, and continue with the installation. 6. After the product installs, opt to restart your system. Installing the DB2 UDB fixpack If you installed DB2 UDB from the WebSphere Application Server CD and you are not using VisualAge for Java Version 3.0, proceed to "Testing installation of prerequisites". DB2 UDB fixpack 10 was installed when you installed the base UDB product. If you did not install DB2 UDB from the WebSphere Application Server CD or are using VisualAge for Java Version 3.0, download the appropriate DB2 UDB fixpack 7 / 38
  8. 8. WebSphere Application Server 버전 3.0 릴리즈 노트 from the product Web site. VisualAge for Java Version 3.0 requires fixpack 11. Otherwise, you may use fixpack 10 or 11. Next, do the following: 1. From the Services panel of the Control Panel, stop the services DB2 - DB2 and DB2 - DB2DAS00. If you have the Netfinity Support Manager or other monitoring agents you may need to stop these as well, since they can lock DB2. 2. Unzip the fixpack file into a temporary directory. Delete the DB2 install directory if you wish. 3. Run setup.exe from the fixpack temporary directory. 4. Click Next, and then Next again. Select the check box to always start the DB2 instance. Consider selecting the check box to start the control center. 5. Click Next. If needed, fill in your Username and password, and click Next again. Then, click Install. When the installation finishes, restart your computer and login as the user you have been using to configure the software. After your system restarts, the DB2 First Steps and Control Center dialogs may display. At this point, you may create the database sample used by the WebSphere Application Server samples. To create the database sample, click Create the SAMPLE database in the DB2 First Steps dialog and then click Yes in the confirmation dialog. 8 / 38
  9. 9. WebSphere Application Server 버전 3.0 릴리즈 노트 If you receive an error message stating that the database was not created, go to the Services dialog accessible from a Control Panel and ensure that the status for the DB2-DB2 service is Started. The startup type for the DB2-DB2 service should be Automatic and the hardware profile should be Enabled. Once you start the DB2- DB2 service, try creating the database sample again. After you finish, close the DB2 dialogs. Testing installation of prerequisites 1. If you have installed some prerequisites and have not since restarted your computer, do so now. 2. Start IBM HTTP Server. From the Start menu, select Programs -> IBM HTTP Server -> Start HTTP Server; or use a Services dialog, which is available from a Control Panel, to start the IBM HTTP Server. If the server does not start, check the README file in the IBM HTTP Server installation directory (c:http for this guide) and take whatever appropriate action is noted in the README file. 3. Open a browser and browse http://localhost/. You should see: 9 / 38
  10. 10. WebSphere Application Server 버전 3.0 릴리즈 노트 4. Select Configure server. 5. When prompted, enter the username and password that you entered in the htpasswd command. 10 / 38
  11. 11. WebSphere Application Server 버전 3.0 릴리즈 노트 When you enter these you should see the configuration page for the Web server. 6. Use the basic settings to check the server name parameter you set earlier. You have now tested and configured DB2 and HTTP Server. Also check that you have the right JDK installed and configured by starting a command prompt and typing: java -fullversion You should see the response java full version "JDK 1.1.7 IBM build n117p-19990823 (JIT enabled: ibmjitc) If you don't, check that c:jdk1.1.7 (or whatever you specified for the IBM JDK directory) has been added to your path. Installing WebSphere Application Server To install WebSphere Application Server, do the following: 11 / 38
  12. 12. WebSphere Application Server 버전 3.0 릴리즈 노트 1. If IBM HTTP Server or another Web server on your system is running, stop the Web server. 2. Run the downloaded executable if you obtained Version 3.02 from the product Web site. Or, run ntsetup.exe if you have the product CD. You will need 30-50Mb free in your temp directory (usually on the C drive), even if you are installing on another drive, because the installation shield package unpacks to the temp directory. This will kick off an installation shield package. 3. If you installing from the product CD, select a language and click OK. 4. Click Next to pass the introductory page. 5. If you already have a JDK and database program installed, but do not have supported versions, a dialog opens informing you of the need to upgrade the prerequisite software. If this dialog is not shown, proceed to step 6. 6. If WebSphere Application Server with the appropriate prerequisites is already installed on your system, a dialog giving you the option to upgrade WebSphere Application Server displays: You now have two options: o To upgrade the product installation, put a check mark in the Upgrade installed product only check box and select Next. The installation package will upgrade the files on your system. After the installation package runs, proceed to "Testing your installation". 12 / 38
  13. 13. WebSphere Application Server 버전 3.0 릴리즈 노트 o To re-install files, do not place a check mark in the Update installed product only check box. Simply click Next. Then, continue with the installation. If WebSphere Application Server is not already installed on your system, proceed to step 7. 7. In the Install Options dialog, select Custom Installation and the installation directory; then click Next. 8. In the Choose Application Server Components dialog, select the following options: o Select IBM HTTP Server V1.3.6 on the right-hand side. You can install the WebSphere plug-ins (which connect the Web server to the servlet engine) into multiple Web servers at once. However, this guide has you install the plug-ins into IBM HTTP Server. o Select Configure administrative domain with default.... This step is important, because the standard installation doesn't install the sample servlets or configure a EJB container or servlet engine. 13 / 38
  14. 14. WebSphere Application Server 버전 3.0 릴리즈 노트 If you are installing from the downloaded file, you will now see: If you are installing from the product CD, you will see: o If you do not have either IBM HTTP Server or DB2 UDB currently installed, select those products you need. (You only have this option if you are installing from the 14 / 38
  15. 15. WebSphere Application Server 버전 3.0 릴리즈 노트 product CD.) 9. Click Next. If necessary, shut down all Web servers you plan to run with WebSphere Application Server and proceed. 10. The system should find any level of IBM JDK that is installed. If you do note have the IBM JDK installed, click Install JDK 1.1.7. "Installing IBM HTTP Server 1.3.6" has information on installing IBM JDK. 15 / 38
  16. 16. WebSphere Application Server 버전 3.0 릴리즈 노트 If you have other JDKs installed, make sure you select the IBM JDK, and click Next. 11. You are now prompted with the Security/Database Options page, which configures the database access and user IDs. The database access is important to WebSphere Application Server, because the product stores the configuration of the server in a set of specially defined tables in the database. Note: If you use an invalid user ID to install WebSphere, it will not successfully register the WebSphere Administrative Server to the NT services database. Fill in the user ID, security password, and confirming password; and specify the user ID and password for the database. For the database values, if you have already installed DB2 UDB, ensure that you specify the Username and 16 / 38
  17. 17. WebSphere Application Server 버전 3.0 릴리즈 노트 Password specified when installing DB2 UDB. Then click Next. 12. Click Next again to begin the installation. 13. Near the end of the installation, you are prompted for the location of the IBM HTTP Server configuration file. The installation tool should successfully find the file for you, so you should see: 17 / 38
  18. 18. WebSphere Application Server 버전 3.0 릴리즈 노트 14. Click OK, and it will finish updating the files and installing. The next panel points you to the README and, if you are installing the samples, states where the samples have been installed and the server to use. For the most recent version of the README or release notes, go to Library section of the product Web site at http://www.ibm.com/software/webservers/appserv/. 18 / 38
  19. 19. WebSphere Application Server 버전 3.0 릴리즈 노트 15. Click Finish, and choose to restart. Finishing prerequisite configuration If you installed IBM HTTP Server or DB2 UDB as part of the WebSphere Application Server installation (that is, you did not install either prerequisite product before installing Application Server), you may need to configure them. See "Installing IBM HTTP Server 1.3.6" or "Installing DB2 Universal Database (UDB)" for details. Further, if you installed DB2 UDB as part of the WebSphere Application Server installation, the installation program should create a database to store the administrative configuration when your system starts up after rebooting. The database definition is based on the JDBC URL you specified during installation; the steps in this guide use jdbc:db2:was for the JDBC URL. Thus, the installation program should create the WAS database with its DB2 application heap size set to 256. To ensure that the WAS database exists, do the following: 1. Go to the Control Center dialog. If it did not open automatically after rebooting, open it as follows: from the Start menu, select Programs -> DB2 for Windows NT -> Administrative Tools -> Control Center. 2. In the DB2 Control Center, expand the tree under Systems. Your DB2 databases are listed under Databases. Examine the list to see if WAS is in it. If you see WAS in the list, proceed to "Testing your installation". If you do not see WAS listed, go to the Services dialog accessible from a Control Panel and set the startup for the DB2-DB2 service to Automatic. Also, ensure that the hardware profile for the DB2-DB2 service is enabled. Then, complete the steps in the next section, "Setting up administrative configuration." Optionally, for information about why the installation program did not create the WAS database, look at the wasdb2.log file. Setting up administrative configuration If the DB2 database WAS has not yet been created, do the following: 1. From the Start menu, select Programs -> DB2 for Windows NT -> Command Line 19 / 38
  20. 20. WebSphere Application Server 버전 3.0 릴리즈 노트 Processor. 2. Enter CREATE DATABASE WAS 3. Wait a minute to allow time for DB2 to create the database. 4. Enter UPDATE DB CFG FOR WAS USING APPLHEAPSZ 256 5. Type quit to leave the CLP, and then exit to finish the command prompt. 6. Restart the machine. If an application heap size of 256 doesn't work for your system, return to the DB2 Command Line Processor and change the application heap size to, for example, 512 using the command: UPDATE DB CFG FOR WAS USING APPLHEAPSZ 512 Testing your installation 1. If you have not rebooted since installing WebSphere Application Server or any of its prerequisites, do so now. 2. Check that WebSphere administrative server has been registered in the Services dialog. Open the Control Panel and select Services. If you scroll down you should see IBM WS AdminServer. 3. Start the service by selecting IBM WS AdminServer and then selecting Start. Wait patiently. To see whether the system is still trying to start the server, examine the Performance page of the Task Manager. 20 / 38
  21. 21. WebSphere Application Server 버전 3.0 릴리즈 노트 If the server is slow to start or does not start successfully, look at the last line in the WebSphereAppServerlogstracefile log. If the trace file says server is open for e-business, the server has started. Hint: You can control the server from a command line or batch file using the following commands: net start "IBM WS AdminServer" net stop "IBM WS AdminServer" Explaining the AdminServer: The AdminServer doesn't run any servlets, Java Server Pages, or Enterprise Beans. Each node can have multiple JVMs known as servers which run the application code. The Admin Server manages these servers, and if they stop, it restarts them. Each server can have EJB Containers to run EJBs, and a servlet engine to run servlets. Servers can either be independent, running different code, or clones which are identical, and the infrastructure manages spreading the incoming requests across the servers. A cluster consists of multiple nodes, each with clones. Although the installation has created a default server, it hasn't started it, so you can't run anything yet. 4. To start the server, run the administrative console, which is how you manage WebSphere Application Server 3.0. From the Start menu, select Programs-> IBM WebSphere -> Application Server 3.0 -> Administrator's Console. This starts a new command shell, followed by a window showing the startup screen. You can minimize the Administrator's Console command shell, which states No remote host or port argument... As to the window, you should see something like this: 21 / 38
  22. 22. WebSphere Application Server 버전 3.0 릴리즈 노트 5. Wait until the little icon in the bottom left corner stops rotating. Then start to administer the server: 1. The basic administrative console is split into three tabs: Tasks, Types, and Topology. Click on the Topology tab, and then click on the + sign next to WebSphere Administrative Domain to expand the view. 2. Your host name should be listed. Expand the view of that node, and you should see an entry called Default Server. Expand that and you will see the default container and servletEngine. 22 / 38
  23. 23. WebSphere Application Server 버전 3.0 릴리즈 노트 3. If the Current State is Stopped, click the green Start button on the tool bar. After an information dialog displays, stating that the server us running, click OK. Note that the current state changes from Stopped to Running. Once the server starts, it is marked in the configuration database that it should be running. If it stops, or if you reboot the machine, the 23 / 38
  24. 24. WebSphere Application Server 버전 3.0 릴리즈 노트 administrative server will automatically restart it. Even if the administrative server fails, it will continue to run. 6. Test the server. Ensure that the IBM HTTP Server is running (Start -> Programs -> IBM HTTP Server -> Start HTTP Server ). Then, open a browser and go to localhost/servlet/snoop, which is a standard sample servlet installed by default. You should see a result like this: The next step is to configure an Enterprise Bean and test the bean. Configuring an Enterprise Bean To test an Enterprise Bean inside WebSphere Application Server, configure one of the samples, and use a sample servlet to test it. The samples in general are documented, 24 / 38
  25. 25. WebSphere Application Server 버전 3.0 릴리즈 노트 and can be located in the Programs -> IBM WebSphere -> Application Server V3.0 -> Samples choice of the Start menu. This exercise uses the Enterprise Bean Increment. This bean is simply a counter. Creating a database If you have not done so already, create the database sample for use with Increment: 1. From the Start menu, select Programs -> DB2 for Windows NT -> First Steps. 2. In the DB2 First Steps dialog, select Create the SAMPLE database. 3. In the dialog that opens, confirm the creation operation. Setting up a DataSource Increment is an Entity Bean, thus it requires a database to store the values of the bean. WebSphere Application Server 3.02 uses a concept from JDBC 2.0 to implement access to persistent stores such as databases, although Version 3.02 is not yet JDBC2.0 compliant. This is called a DataSource. The DataSource is important for two reasons. First, it gives connection pooling to databases, so WebSphere can reuse database connections. Second, for BMP or session beans, it creates a model where the bean can ask the application server for a connection. This gives the application server the hook it needs to grab the XA resource manager handle so that it can become the transaction coordinator for the transaction. The way this works is by defining a JDBCDriver to the Application Server, then a particular database as a DataSource. This database is given a local name, which will be made available in the JNDI name space. Servlets and BMP or Session Beans that want to access the DataSource can retrieve it using a JNDI lookup, and then get a standard JDBC connection from the DataSource. This is documented under Connection Pooling in the online help. The DataSource is the object that applications will be configured to use. WebSphere Application Server 3.02 separates the DataSource from the JDBC driver. This is important, because you may want to reconfigure a DataSource to use an alternative driver (for example, one that supports two-phase commits for transactions). 25 / 38
  26. 26. WebSphere Application Server 버전 3.0 릴리즈 노트 To configure a DataSource: 1. Go to the Types tab, right-click on JDBCDrivers, and then select Create. 2. For Name, enter DB2AppDriver and, for Implementation class, select COM.ibm.db2.jdbc.app.DB2Driver. Leave the URL prefix as jdbc:db2 and JTA Enabled as false. (JTA is the transaction API. DB2 6.1 FP1 provides a JTA enabled driver, but 5.2 does not.) 3. Click Create and, after a dialog opens stating that the create command was successful, click OK. 26 / 38
  27. 27. WebSphere Application Server 버전 3.0 릴리즈 노트 4. Right-click on DataSources and select Create. In the Create a DataSource dialog, enter sampledb for Name and sample for Database name. The first entry, Name, is used to create the JNDI directory entry for the database. For CMP Enterprise Beans such as the sample Increment, the server will automatically pick this up. For servlets and non-CMP beans, this will make a JNDI name of jdbc/sampledb. See the connection pool sample program for a programming example. The second entry, Database name, is the name of the database, and is concatenated with the URL prefix field (see above) to make the full JDBC URL of the database. The name in this example, sample, was created when you installed DB2. For the last field, Driver, the only choice is DB2AppDriver because it is the only JDBCDriver defined. 27 / 38
  28. 28. WebSphere Application Server 버전 3.0 릴리즈 노트 5. Click on the Advanced tab. You will see the connection pool parameters, which control the performance of the pool. The minimum and maximum connection pool sizes are clear. The Connection timeout (default 300 seconds = 5 minutes) means that if the pool reaches the maximum, new connections will wait this long for a new connection before timing out. The Idle timeout of 1800 seconds (30 minutes), means that if connections in the pool are unused for 30 minutes they will be closed down to the minimum. The Orphan timeout field indicates how long a connection can remain allocated before the server decides that the owner thread has died and the connection should be recovered. 6. Accept the defaults by clicking on Create, and then OK. If you now click on the Topology view you should see the sampledb and DB2AppDriver objects: 28 / 38
  29. 29. WebSphere Application Server 버전 3.0 릴리즈 노트 If you don't, try refreshing the view. Select WebSphere Admin Domain and click on the Refresh selected subtree button. 7. Install the driver by right-clicking on the DB2AppDriver object and selecting Install. 8. Select the node on which to install--in this case there will be only one--and then click Browse: 9. Browse for the JDBC driver JAR/ZIP file which contains the JDBC driver for this database. For DB2 and the standard installation this is C:SQLLIBjavadb2java.zip. Select the file, then click Open, Install, and OK. Deploying and installing the Enterprise Bean 1. In the administrative console and from the Topology view, make sure the node (your host), and Default Server is expanded. Right-click on the Default Container entry, and select 29 / 38
  30. 30. WebSphere Application Server 버전 3.0 릴리즈 노트 Create -> EnterpriseBean. Note that the right-click behavior is different when the object is running. You must hold down the right mouse button while you browse the pop-up menu, and then let go on the selection you want to make. This prevents a random click from affecting the server. You are prompted with a dialog: 2. Click on Browse and navigate to C:WebSphereAppServerdeployableEJBs (or the directory where it is installed). You are browsing the server directories here, so even if you were using the console on a remote machine, this would be the server directory you see. Note: Each EJB-JAR file can contain more than one EJB. WebSphere Application Server Version 3.02 includes a EJB-JAR browser, and this example uses an individual bean to deploy. 30 / 38
  31. 31. WebSphere Application Server 버전 3.0 릴리즈 노트 Select Increment.jar and double-click on it. You should see "inside" the JAR file now: 3. Double-click on the .ser file to select it. When prompted, select Yes: A dialog stating that the Enterprise Bean is deploying briefly displays. During this deployment process, the product generates the code to actually run the Enterprise Bean in the server. This includes code to persist the state (for an Entity Bean), manage transactions, and also the RMI-IIOP stubs and ties. 4. When the system finishes deploying the Enterprise Bean, a dialog opens stating that the deployment was sucessful. Click OK and you will be presented with the Bean dialog again, but now with the fields filled in. 31 / 38
  32. 32. WebSphere Application Server 버전 3.0 릴리즈 노트 The Database Access field (greyed out) is set to Shared, which is equivalent to Option C locking/caching, and supports clustering. You can now look at the deployment descriptor by clicking the Edit button: Only the JNDI name and the environment variables are editable here. This is because updating other properties requires re-generating the code. To update other properties, edit the deployment descriptor using VisualAge for Java Enterprise Edition, or use the standalone EJB tool, jetace, which is included with WebSphere Application Server. Don't change any properties now. 5. After you finish viewing the deployment descriptor, click OK to return to the first dialog, and 32 / 38
  33. 33. WebSphere Application Server 버전 3.0 릴리즈 노트 select the DataSource tab. Click Change and, in the Datasource dialog, select the sampledb DataSource: 6. Click Ok. Because WebSphere is running under the user ID that has full rights to DB2, you can leave the user ID and password blank. Alternatively you can enter a valid user ID and password that has access to this database. 7. Click on the Advanced tab. The following is displayed: This defines the pool size for the bean. In general, WebSphere tries to optimize Enterprise Bean access by re-using existing beans where the semantics of the EJB specification allow it. Note that the maximum is not a hard maximum, but the maximum number of instances that will be held alive. The Find for update field specifies the locking behavior of the bean. It reduces deadlock when beans are updated. Normally, when a findByPrimaryKey 33 / 38
  34. 34. WebSphere Application Server 버전 3.0 릴리즈 노트 is issued, WebSphere Application Server puts a shared lock on the database row and then, if the client updates the bean, WebSphere Application Server converts it to an exclusive lock. If two transactions run at the same time, deadlock occurs. If this is likely to happen, enabling Find for update causes the product to use an exclusive lock when the find is issued, avoiding deadlock. 8. Click Create. The following dialog is displayed: 9. Click OK to clear the dialog. 10. You can deploy a new Enterprise Bean into an already running container. To start the bean, select the Increment object, which is under Default Server and Default Container in the Topology view, and select the green Start button on the tool bar. Then, click OK to clear the dialog that Increment is running. Testing the deployment To test the deployment, go to the samples page: 1. From the Start menu, select Programs -> IBM WebSphere -> Application Server 3.0 -> Samples. 2. Click on Enterprise Beans in the left frame, and then choose Increment from the right frame. 3. Select Run this sample, and you should see: 34 / 38
  35. 35. WebSphere Application Server 버전 3.0 릴리즈 노트 4. Click Visit, and the number of visits information should be displayed: Click on Visit Again repeatedly, and the number will increase by one each time. You have now installed and configured an EJB application. 35 / 38
  36. 36. WebSphere Application Server 버전 3.0 릴리즈 노트 Examining the database To see what is going on in the database, start up the DB2 Command Line Processor: 1. From the Start menu, select DB2 for Windows NT -> Command Line Processor. 2. Enter 3. connect to sample 4. select * from ejb.incrementbeantbl Data similar to the following is displayed: db2 => connect to sample Database Connection Information Database server = DB2/NT 5.2.0 SQL authorization ID = MYID Local database alias = SAMPLE db2 => select * from ejb.incrementbeantbl COUNT PRIMARYKEY ------- --------------------- 5 count 1 record(s) selected. db2 => Setting up TCP/IP for standalone operations You must have TCP/IP networking installed. If you will run WebSphere Application Server as a standalone (not connected to a network), your host name must remain fixed. WebSphere Application Server is a "networked" system that can be clustered into a single domain, with the administration and other aspects rely upon the IP networking. When the product starts for the first time, it records the host name. When it restarts, it needs to be able to contact that IP address again. If you wish to use 36 / 38
  37. 37. WebSphere Application Server 버전 3.0 릴리즈 노트 WebSphere Application Server "disconnected", you must still always be able to "ping" your host name successfully. If you need to set up a fixed IP address, go to the Network section of the Control Panel, in the Adapters tab, and install the MS Loopback Adapter. Then, go to the Protocols tab, open TCP/IP properties, and specify a fixed TCP/IP address of 10.0.0.1 (which is an address reserved for private use and thus appropriate for standalone operations), and a subnet mask of 255.255.255.0. No default gateway for this adapter was specified. Go to the Bindings tab, select all protocols, expand TCP/IP Protocol, and then move the MS Loopback Adapter to 37 / 38
  38. 38. WebSphere Application Server 버전 3.0 릴리즈 노트 the top of the TCP/IP Protocol list as shown below. Save the changes and reboot. After rebooting, you should be able to ping your host name whether or not you are connected to a network. To test your new TCP/IP setup, ping your host name while running standalone and, optionally, while connected to a network. 38 / 38

×